diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-11-21 16:01:41 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-11-21 16:01:41 +0100 |
| commit | 904f68134bb3f6b50629ddcb6007b3a735ce4b72 (patch) | |
| tree | cda8ea0fb81e8db44c8dfd1a4a96a7b1a301f81a /userspace | |
| parent | 65a859ac5b721c8d3e0123351ad99690e2e7a876 (diff) | |
working on ELF bin support
Diffstat (limited to 'userspace')
| -rw-r--r-- | userspace/Makefile | 42 | ||||
| -rw-r--r-- | userspace/add.c | 2 | ||||
| -rw-r--r-- | userspace/brainfuck.c | 3 | ||||
| -rw-r--r-- | userspace/shell.c | 2 | ||||
| -rw-r--r-- | userspace/simple.c | 2 |
5 files changed, 23 insertions, 28 deletions
diff --git a/userspace/Makefile b/userspace/Makefile index 29f6c7b..df79065 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -1,12 +1,9 @@ -#i686-elf-gcc test.c -L/home/miguel/temp/fool-os-stuff/newlib-build-clean/i686-elf/newlib/ -I/home/miguel/temp/fool-os-stuff/newlib-2.1.0/newlib/libc/include/ -L/home/miguel/temp/fool-os-stuff/newlib-build-clean/i686-elf/libgloss/libnosys/ - CC=i686-foolos-gcc -LD=i686-foolos-ld PROGS=shell simple brainfuck add -ext2.img: shell simple brainfuck add - dd if=/dev/zero of=ext2.img bs=512 count=3500 +ext2.img: $(PROGS) shell.bin + dd if=/dev/zero of=ext2.img bs=512 count=2000 sudo mkfs.ext2 -O none ext2.img -F mkdir mnt sudo mount ext2.img mnt @@ -14,33 +11,36 @@ ext2.img: shell simple brainfuck add mkdir mnt/miguel echo "hello one" > mnt/miguel/test1.txt echo "hello two" > mnt/test2.txt - cp shell mnt - cp simple mnt - cp brainfuck mnt - cp add mnt - cp ~/temp/fool-os-stuff/binutils-fool-build/binutils/ar.bin mnt + cp $< mnt +# cp shell.bin mnt + cp ~/temp/fool-os-stuff/binutils-fool-build/binutils/elfedit mnt sync sudo umount mnt rm mnt -rf -brainfuck: brainfuck.o crt0.o - ${CC} -T linker.ld ${LDFLAGS} $< -o $@ - -shell: foolshell.o crt0.o - ${CC} -T linker.ld ${LDFLAGS} $< -o $@ +#shell.bin: shell.c +# ${CC} -T sys/oldlinker.ld -shell.c o shell.bin +# objcopy -O binary shell shell.bin + +brainfuck: brainfuck.o +shell: shell.o +simple: simple.o +add: add.o -simple: simple.o crt0.o - ${CC} -T linker.ld ${LDFLAGS} $< -o $@ - -add: add.o crt0.o - ${CC} -T linker.ld ${LDFLAGS} $< -o $@ clean: - -rm *.o *.out shell simple ext2.img brainfuck add + -rm *.o $(PROGS) ext2.img + +mount: + mkdir mnt + sudo mount ext2.img mnt + sudo chown miguel mnt umount: sudo umount mnt rm mnt -rf +new: clean ext2.img + diff --git a/userspace/add.c b/userspace/add.c index 254ee35..2a13adf 100644 --- a/userspace/add.c +++ b/userspace/add.c @@ -1,6 +1,6 @@ #include <stdio.h> #include <string.h> -#include "syscalls.c" +#include <stdint.h> #include "../fs/fs.h" int main(int argc, char **argv) diff --git a/userspace/brainfuck.c b/userspace/brainfuck.c index fdabb3c..6bb28cb 100644 --- a/userspace/brainfuck.c +++ b/userspace/brainfuck.c @@ -16,9 +16,6 @@ */ -// ADDED BY FOOLOS : foolos syscalls! -#include "syscalls.c" - #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/userspace/shell.c b/userspace/shell.c index 36912c8..544da96 100644 --- a/userspace/shell.c +++ b/userspace/shell.c @@ -1,7 +1,7 @@ #include <stdio.h> +#include <stdint.h> #include <assert.h> #include <string.h> -#include "syscalls.c" #include "../fs/fs.h" void hello() { diff --git a/userspace/simple.c b/userspace/simple.c index 6dcf766..fa809a8 100644 --- a/userspace/simple.c +++ b/userspace/simple.c @@ -1,5 +1,3 @@ -#include "syscalls.c" - int main(int argc, char **argv) { int i; |
