diff options
Diffstat (limited to 'userspace')
| -rw-r--r-- | userspace/Makefile | 24 | ||||
| -rw-r--r-- | userspace/linker.ld | 2 | ||||
| -rw-r--r-- | userspace/syscalls.c | 7 |
3 files changed, 25 insertions, 8 deletions
diff --git a/userspace/Makefile b/userspace/Makefile index fc5e2dd..11eaa74 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -3,12 +3,30 @@ CC=i686-elf-gcc LD=i686-elf-ld -CFLAGS=-I/home/miguel/temp/fool-os-stuff/newlib-2.1.0/newlib/libc/include +CFLAGS=-I/home/miguel/temp/fool-os-stuff/newlib-2.1.0/newlib/libc/include LDFLAGS=-L/home/miguel/temp/fool-os-stuff/newlib-build-clean/i686-elf/newlib/ \ -L/home/miguel/temp/fool-os-stuff/newlib-build-clean/i686-elf/libgloss/libnosys/ \ -lnosys -all: foolshell.o crt0.o +ext2.img: userprog + dd if=/dev/zero of=ext2.img bs=512 count=200 + sudo mkfs.ext2 -O none ext2.img + mkdir mnt + sudo mount ext2.img mnt + sudo chown miguel mnt + mkdir mnt/miguel + echo "hello one" > mnt/miguel/test1.txt + echo "hello two" > mnt/test2.txt + cp userprog mnt/shell + sync + sudo umount mnt + rm mnt -rf + +userprog: foolshell.o crt0.o ${CC} -T linker.ld ${LDFLAGS} $< -Wl,--oformat,binary -o userprog + clean: - -rm *.o *.out userprog + -rm *.o *.out userprog ext2.img + + + diff --git a/userspace/linker.ld b/userspace/linker.ld index bfaae93..1d10d3e 100644 --- a/userspace/linker.ld +++ b/userspace/linker.ld @@ -1,4 +1,4 @@ SECTIONS { - . = 0x80800; + . = 0x100000; } diff --git a/userspace/syscalls.c b/userspace/syscalls.c index f92541c..b514eab 100644 --- a/userspace/syscalls.c +++ b/userspace/syscalls.c @@ -13,9 +13,11 @@ easywrite(char *c); void syscalls_init() { preread=0; - alloc=0xff0000; + alloc=0x500000; } +// + int close(int file) { // easywrite("syscall: close\n"); @@ -43,8 +45,6 @@ int lseek(int file, int ptr, int dir) return preread; } - - int read(int file, char *ptr, int len) { int ebx; // will hold return value; @@ -158,7 +158,6 @@ caddr_t sbrk(int incr) return (caddr_t) prev_heap_end; */ } - // // helpers |
