summaryrefslogtreecommitdiff
path: root/userspace/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/Makefile')
-rw-r--r--userspace/Makefile24
1 files changed, 21 insertions, 3 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
+
+
+