-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
36 lines (28 loc) · 1.02 KB
/
Copy pathmakefile
File metadata and controls
36 lines (28 loc) · 1.02 KB
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
# sudo apt-get install g++ binutils libc6-dev-i386
#
GCCPARAMS = -m32 -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -fno-exceptions -fno-leading-underscore
ASPARAMS = --32
LDPARAMS = -melf_i386
objects = loader.o kernel.o
%.o: %.cpp
gcc $(GCCPARAMS) -c -o $@ $<
%.o: %.s
as $(ASPARAMS) -o $@ $<
nos4.bin: linker.ld $(objects)
ld $(LDPARAMS) -T $< -o $@ $(objects)
install: nos4.bin
sudo cp $< /boot/nos4.bin
nos4.iso: nos4.bin
mkdir iso
mkdir iso/boot
mkdir iso/boot/grub
cp nos4.bin iso/boot/nos4.bin
echo 'set timeout=0' > iso/boot/grub/grub.cfg
echo 'set default=0' >> iso/boot/grub/grub.cfg
echo '' >> iso/boot/grub/grub.cfg
echo 'menuentry "My Operating System" {' >> iso/boot/grub/grub.cfg
echo ' multiboot /boot/nos4.bin' >> iso/boot/grub/grub.cfg
echo ' boot' >> iso/boot/grub/grub.cfg
echo '}' >> iso/boot/grub/grub.cfg
grub-mkrescue --output=nos4.iso iso
rm -rf iso