mirror of
https://github.com/xomboverlord/xomb-bare-bones.git
synced 2026-01-11 18:33:15 +01:00
Added some stuff. I hope to figure out the unsupported binary format thing with bochs + grub soon.
Signed-off-by: The XOmB Overlord <overlord@xomb.net>
This commit is contained in:
committed by
The XOmB Overlord
parent
432ee732ac
commit
81d8b09b83
@@ -26,7 +26,7 @@ cp ../kernel/arch/x86/imports/compile_typeinfo.sh dsss_imports/.;\
|
||||
cp ../kernel/arch/x86/imports/architecture.d dsss_imports/.;\
|
||||
echo ; \
|
||||
echo Compiling Assembly for target: x86_64 ;\
|
||||
echo '--> boot.S';\
|
||||
echo '--> boot.s';\
|
||||
yasm -felf32 -mx86 -o dsss_objs/O/kernel.arch.x86.boot.boot.o ../kernel/arch/x86/boot/boot.s;\
|
||||
\
|
||||
echo ; \
|
||||
|
||||
@@ -20,10 +20,10 @@ bits 32
|
||||
; externs given by the linker script
|
||||
extern _edata
|
||||
extern _end
|
||||
extern _boot
|
||||
|
||||
; extern to the load.s
|
||||
extern start64
|
||||
extern stack
|
||||
; extern for kmain
|
||||
extern kmain
|
||||
|
||||
; other definitions
|
||||
|
||||
@@ -32,14 +32,6 @@ extern stack
|
||||
; define the starting point for this module
|
||||
global start
|
||||
global _start
|
||||
start:
|
||||
_start:
|
||||
|
||||
; Stash values for multiboot we won't touch until 64 bit mode
|
||||
mov esi, ebx
|
||||
mov edi, eax
|
||||
|
||||
jmp start32
|
||||
|
||||
; the multiboot header needs to be aligned at
|
||||
; a 32 bit boundary
|
||||
@@ -51,23 +43,40 @@ _start:
|
||||
dd MULTIBOOT_HEADER_FLAGS
|
||||
dd -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
|
||||
dd multiboot_header
|
||||
dd _start
|
||||
dd _boot
|
||||
dd _edata
|
||||
dd _end
|
||||
dd _start
|
||||
|
||||
; the 32 bit entry
|
||||
global start32
|
||||
start32:
|
||||
start:
|
||||
_start:
|
||||
|
||||
; disable interrupts
|
||||
cli
|
||||
|
||||
_loop:
|
||||
jmp _loop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
; establish stack (point to bottom)
|
||||
mov esp, stack+STACK_SIZE
|
||||
|
||||
; pass multiboot information
|
||||
push eax
|
||||
push ebx
|
||||
|
||||
; call kmain
|
||||
call kmain
|
||||
|
||||
_halt:
|
||||
|
||||
cli
|
||||
|
||||
hlt
|
||||
jmp _halt
|
||||
|
||||
nop
|
||||
nop
|
||||
|
||||
section .bss
|
||||
align 32
|
||||
stack:
|
||||
resb STACK_SIZE
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ kernel_VMA = 0x100000;
|
||||
kernel_LMA = 0x100000;
|
||||
|
||||
/* start from the entry point */
|
||||
|
||||
OUTPUT_FORMAT("elf32-i386")
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user