clean up some legacy util stuff

This commit is contained in:
Kevin Lange 2013-12-13 20:50:04 -08:00
parent ebe1c24dbd
commit ed3c578e64
4 changed files with 4 additions and 105 deletions

View File

@ -1,6 +1,4 @@
# ToAruOS Primary Build Script
# This script will pull either clang (with -fcolor-diagnostics), gcc (with no extra options), or cc
#
ifeq ($(CCC_ANALYZE),yes)
# CC is set by CCC_ANALYZE to clang
# It is not recommended that you use a kernel built this way
@ -9,25 +7,14 @@ CC = i686-pc-toaru-gcc
endif
# CFLAGS for core components
CFLAGS = -Wall -Wextra -pedantic -m32 -O0 -std=c99 -finline-functions -fno-stack-protector -nostdinc -ffreestanding -Wno-unused-function -Wno-unused-parameter -Wstrict-prototypes -g
# CFLAGS for native utils
NATIVEFLAGS = -std=c99 -g -pedantic -Wall -Wextra -Wno-unused-parameter
# Linker for core
LD = i686-pc-toaru-ld
YASM = yasm
# Feel free to be specific, but I'd rather you not be.
FILESYSTEMS = $(patsubst %.c,%.o,$(wildcard kernel/fs/*.c))
VIDEODRIVERS = $(patsubst %.c,%.o,$(wildcard kernel/video/*.c))
DEVICES = $(patsubst %.c,%.o,$(wildcard kernel/devices/*.c))
VIRTUALMEM = $(patsubst %.c,%.o,$(wildcard kernel/mem/*.c))
MISCMODS = $(patsubst %.c,%.o,$(wildcard kernel/misc/*.c))
SYSTEM = $(patsubst %.c,%.o,$(wildcard kernel/sys/*.c))
DATASTRUCTS = $(patsubst %.c,%.o,$(wildcard kernel/ds/*.c))
CPUBITS = $(patsubst %.c,%.o,$(wildcard kernel/cpu/*.c))
SUBMODULES = $(patsubst %.c,%.o,$(wildcard kernel/*/*.c))
SUBMODULES = ${MODULES} ${FILESYSTEMS} ${VIDEODRIVERS} ${DEVICES} ${VIRTUALMEM} ${MISCMODS} ${SYSTEM} ${DATASTRUCTS} ${CPUBITS}
USERSPACE = $(shell find userspace/ -type f -name '*.c') $(shell find userspace/ -type f -name '*.cpp') $(shell find userspace/ -type f -name '*.h')
UTILITIES = util/bin/readelf util/bin/typewriter util/bin/bim
EMU = qemu-system-i386
GENEXT = genext2fs
DISK_SIZE = 524288
@ -46,11 +33,10 @@ ENDRM = util/mk-end-rm
EMUARGS = -sdl -kernel toaruos-kernel -m 1024 -serial stdio -vga std -hda toaruos-disk.img -k en-us -no-frame -rtc base=localtime
EMUKVM = -enable-kvm
.PHONY: all system clean clean-once clean-hard clean-soft clean-bin clean-aux clean-core install run utils
.PHONY: all system clean clean-once clean-hard clean-soft clean-bin clean-aux clean-core install run
.SECONDARY:
all: .passed system tags
aux: utils
system: .passed toaruos-disk.img toaruos-kernel
install: system
@ -86,8 +72,6 @@ run-config: system
test: system
python util/run-tests.py 2>/dev/null
utils: ${UTILITIES}
.passed:
@util/check-reqs > /dev/null
@touch .passed
@ -142,20 +126,6 @@ toaruos-disk.img: .userspace-check
@${END} "hdd" "Generated Hard Disk image"
@${INFO} "--" "Hard disk image is ready!"
################
# Utilities #
################
util/bin/bim: userspace/bim.c
@${BEG} "CC" "$<"
@${CC} -std=c99 -posix -m32 -g -o $@ $< userspace/lib/wcwidth.c
@${END} "CC" "$<"
util/bin/%: util/%.c
@${BEG} "CC" "$<"
@${CC} ${NATIVEFLAGS} -o $@ $< ${ERRORS}
@${END} "CC" "$<"
##############
# ctags #
##############
@ -179,11 +149,6 @@ clean-bin:
@-rm -f hdd/bin/*
@${ENDRM} "RM" "Cleaned native binaries"
clean-aux:
@${BEGRM} "RM" "Cleaning auxillary files..."
@-rm -f util/bin/*
@${ENDRM} "RM" "Cleaned auxillary files"
clean-core:
@${BEGRM} "RM" "Cleaning final output..."
@-rm -f toaruos-kernel
@ -193,7 +158,7 @@ clean-core:
clean: clean-soft clean-core
@${INFO} "--" "Finished soft cleaning"
clean-hard: clean clean-bin clean-aux
clean-hard: clean clean-bin
@${INFO} "--" "Finished hard cleaning"
clean-disk:

View File

@ -1,48 +0,0 @@
/*
* ToAruOS DevFS
*
*/
#include <system.h>
#include <fs.h>
uint32_t read_devfs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer);
uint32_t write_devfs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer);
void open_devfs(fs_node_t *node, uint8_t read, uint8_t write);
void close_devfs(fs_node_t *node);
struct dirent *readdir_devfs(fs_node_t *node, uint32_t index);
fs_node_t *finddir_devfs(fs_node_t *node, char *name);
fs_node_t * devfs_root;
/*
* Install the DevFS to the given path.
* Path should be `/dev`
*/
void
devfs_install(char * path) {
fs_node_t * dev_node = kopen(path,0);
kprintf("Installing devfs... %s\n", dev_node->name);
}
/*
* These functions require that the requested node have a valid handler of their own
* and are not part of the devfs natively
*/
uint32_t read_devfs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) {
return -1;
}
uint32_t write_devfs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) {
return -1;
}
fs_node_t *
devfs_create_keyboard(void) {
return NULL;
}
/*
* vim:noexpandtab
* vim:tabstop=4
* vim:shiftwidth=4
*/

View File

@ -8,7 +8,7 @@
#include <stdint.h>
/* The Master ELF Header */
#include "../kernel/include/elf.h"
#include "../../kernel/include/elf.h"
/**
* Show usage for the readelf application.

View File

@ -1,18 +0,0 @@
#define _XOPEN_SOURCE 500
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char ** argv) {
if (argc < 3) { return -1; }
FILE * f = fopen(argv[2],"r");
char * buffer = malloc(sizeof(char) * 1);
while (!feof(f)) {
fread(buffer, 1, 1, f);
printf("%c", buffer[0]);
fflush(stdout);
usleep(atoi(argv[1]));
}
fclose(f);
return 0;
}