blob: ceba7d07e7ca02630deefeff13db9b2f4bd3ae1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#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-elf-gcc
LD=i686-elf-ld
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
ext2.img: shell simple
dd if=/dev/zero of=ext2.img bs=512 count=200
sudo mkfs.ext2 -O none ext2.img -F
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 shell mnt
cp simple mnt
sync
sudo umount mnt
rm mnt -rf
shell: foolshell.o crt0.o
${CC} -T linker.ld ${LDFLAGS} $< -Wl,--oformat,binary -o shell
simple: simple.o crt0.o
${CC} -T linker.ld ${LDFLAGS} $< -Wl,--oformat,binary -o simple
clean:
-rm *.o *.out shell simple ext2.img
umount:
sudo umount mnt
rm mnt -rf
|