-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: src/Makefile src/fd.img src/menu.lst Got rid of the fd.img in favor of img.iso. Still some cleanup to do, but I wanted to just blindly resolve conflicts in one commit, and fully fix them in a second.
- Loading branch information
Showing
5 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
img.iso | ||
*.o | ||
image.elf | ||
iso/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
all: clean src | ||
img := img.iso | ||
srcs := $(wildcard *.c *.s) | ||
objs := 00entry.o $(srcs:%.c=%.o) | ||
objs := $(objs:%.s=%.o) | ||
target := ixmage.elf | ||
AS=$(CC) | ||
CFLAGS = -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -I../include/ | ||
ASFLAGS := $(CFLAGS) -c | ||
|
||
all: src | ||
|
||
clean: | ||
rm -f *.o ixmage.elf doc.txt | ||
|
||
src: clean | ||
nasm -felf start.asm -o 00entry.o | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o gdt.o -I ../include/ gdt.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o isrs.o -I ../include/ isrs.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o util.o -I ../include/ util.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o irq.o -I ../include/ irq.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o timer.o -I ../include/ timer.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o idt.o -I../include/ idt.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o kernel_assert.o -I../include/ kernel_assert.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o kernel_halt.o -I../include/ kernel_halt.s | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o io.o -I../include/ io.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o ix_main.o -I../include/ ix_main.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o kb.o -I../include/ kb.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o vga.o -I../include/ vga.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o zz.o -I../include/ zz.c | ||
gcc -Wall -mtune=i386 -mno-mmx -mno-3dnow -mno-sse2 -mno-sse3 -mno-sse -mno-tls-direct-seg-refs -nostdlib -nostdinc -ffreestanding -c -o kaukatcr.o -I../include/ kaukatcr.c | ||
ld -nostdlib -Tlink.ld *.o -o ixmage.elf | ||
|
||
image: clean src | ||
mkdir -p mnt | ||
sudo mount -o loop fd.img ./mnt/ | ||
sudo cp menu.lst ./mnt/boot/menu.cfg | ||
sudo cp ixmage.elf ./mnt/ | ||
sudo umount ./mnt/ | ||
-rm -f $(objs) $(target) $(img) doc.txt | ||
|
||
00entry.o: start.asm | ||
nasm -f elf32 $< -o $@ | ||
|
||
$(target): link.ld $(objs) | ||
ld -nostdlib -Tlink.ld $(objs) -o $(target) | ||
|
||
src: $(target) | ||
|
||
image: $(img) | ||
|
||
$(img): $(target) menu.lst | ||
mkdir -p iso/boot/grub | ||
cp /boot/grub/stage2_eltorito iso/boot/grub | ||
sudo cp menu.lst iso/boot/grub/menu.lst | ||
sudo cp $(target) iso/ | ||
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \ | ||
-boot-load-size 4 -boot-info-table -o $(img) iso/ | ||
|
||
test: image | ||
qemu -no-reboot -no-shutdown -fda fd.img | ||
qemu -no-reboot -no-shutdown -boot d -cdrom $(img) | ||
|
||
install: src | ||
sudo cp ixmage.elf /boot/ | ||
|
||
sudo cp $(target) /boot/ | ||
|
||
.PHONY: image test install all src clean | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
timeout 5 | ||
|
||
title ix | ||
root (fd0) | ||
kernel /ixmage.elf | ||
# grub infers this for us root (cd) | ||
kernel --type=multiboot /image.elf | ||
boot | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters