bootable with small multiboot kernel
git-svn-id: svn://anubis/hos/trunk@5 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
1 parent
bdf4ce8ae8
commit
8f00324b30
4 files changed
+46
-4
No files matched your search
+6
-2
@@ -1,8 +1,12 @@
|
||||
|
||||
KERNEL = hos
|
||||
TARGET = elf32-i386
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
all:
|
||||
@echo Nothing yet
|
||||
nasm -f elf -o boot.o boot.asm
|
||||
ld --oformat $(TARGET) -o $(KERNEL) boot.o
|
||||
|
||||
clean:
|
||||
@echo Nothing yet
|
||||
-rm -f *~ $(KERNEL) *.o
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
%define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||
%define MULTIBOOT_HEADER_FLAGS 0x3
|
||||
|
||||
[global start]
|
||||
[global _start]
|
||||
start:
|
||||
_start:
|
||||
jmp multiboot_entry
|
||||
align 4
|
||||
|
||||
multiboot_header:
|
||||
; magic
|
||||
dd MULTIBOOT_HEADER_MAGIC
|
||||
; flags
|
||||
dd MULTIBOOT_HEADER_FLAGS
|
||||
; checksum
|
||||
dd -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
|
||||
|
||||
multiboot_entry:
|
||||
mov byte [0xB8000+160*10+2*2], 'J'
|
||||
mov byte [0xB8001+160*10+2*2+1], 0x07
|
||||
|
||||
looplbl:
|
||||
hlt
|
||||
jmp looplbl
|
||||
|
||||
Reference in new issue
Block a user