I guess it barely prints a thing
This commit is contained in:
commit
f30433dd27
5 changed files with 79 additions and 0 deletions
43
start32.asm
Normal file
43
start32.asm
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
; Tutorial: A small kernel with Fasm & TCC
|
||||
; By Tommy.
|
||||
|
||||
format elf
|
||||
use32
|
||||
|
||||
;
|
||||
; Equates
|
||||
;
|
||||
MULTIBOOT_PAGE_ALIGN equ (1 shl 0)
|
||||
MULTIBOOT_MEMORY_INFO equ (1 shl 1)
|
||||
MULTIBOOT_AOUT_KLUDGE equ (1 shl 16)
|
||||
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
|
||||
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN or MULTIBOOT_MEMORY_INFO
|
||||
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
|
||||
|
||||
|
||||
;
|
||||
; Multiboot header
|
||||
;
|
||||
.multiboot: align 4
|
||||
dd MULTIBOOT_HEADER_MAGIC
|
||||
dd MULTIBOOT_HEADER_FLAGS
|
||||
dd MULTIBOOT_CHECKSUM
|
||||
|
||||
|
||||
section '.bss' writable align 16
|
||||
stack_bottom:
|
||||
rb 16384
|
||||
stack_top:
|
||||
|
||||
section '.text' executable
|
||||
;
|
||||
; Kernel entry point.
|
||||
;
|
||||
public _start
|
||||
extrn kmain
|
||||
_start:
|
||||
; Call the main kernel function.
|
||||
call kmain
|
||||
|
||||
@@:
|
||||
jmp @b
|
||||
Loading…
Add table
Add a link
Reference in a new issue