Made Kernel 'Higher-Half' and enabled paging.
git-svn-id: https://spexeah.com:8443/svn/Asuro@85 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
ENTRY(kstart)
|
||||
SECTIONS
|
||||
{
|
||||
.text 0x100000 :
|
||||
{
|
||||
text = .; _text = .; __text = .;
|
||||
*(.text)
|
||||
. = ALIGN(4096);
|
||||
}
|
||||
.data :
|
||||
{
|
||||
data = .; _data = .; __data = .;
|
||||
*(.data)
|
||||
kimage_text = .;
|
||||
LONG(text);
|
||||
kimage_data = .;
|
||||
LONG(data);
|
||||
kimage_bss = .;
|
||||
LONG(bss);
|
||||
kimage_end = .;
|
||||
LONG(end);
|
||||
. = ALIGN(4096);
|
||||
}
|
||||
.bss :
|
||||
{
|
||||
bss = .; _bss = .; __bss = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4096);
|
||||
}
|
||||
end = .; _end = .; __end = .;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
;
|
||||
; Kernel stub
|
||||
;
|
||||
|
||||
;
|
||||
; We are in 32bits protected mode
|
||||
;
|
||||
[bits 32]
|
||||
|
||||
;
|
||||
; Export entrypoint
|
||||
;
|
||||
[global kstart]
|
||||
|
||||
;
|
||||
; Import kernel entrypoint
|
||||
;
|
||||
[extern kmain]
|
||||
|
||||
;
|
||||
; Posible multiboot header flags
|
||||
;
|
||||
MULTIBOOT_MODULE_ALIGN equ 1<<0
|
||||
MULTIBOOT_MEMORY_MAP equ 1<<1
|
||||
MULTIBOOT_GRAPHICS_FIELDS equ 1<<2
|
||||
MULTIBOOT_ADDRESS_FIELDS equ 1<<16
|
||||
|
||||
;
|
||||
; Multiboot header defines
|
||||
;
|
||||
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
|
||||
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_MODULE_ALIGN | MULTIBOOT_MEMORY_MAP
|
||||
MULTIBOOT_HEADER_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
|
||||
|
||||
;
|
||||
; Kernel stack size
|
||||
;
|
||||
KERNEL_STACKSIZE equ 0x4000
|
||||
|
||||
section .text
|
||||
|
||||
;
|
||||
; Multiboot header
|
||||
;
|
||||
align 4
|
||||
dd MULTIBOOT_HEADER_MAGIC
|
||||
dd MULTIBOOT_HEADER_FLAGS
|
||||
dd MULTIBOOT_HEADER_CHECKSUM
|
||||
|
||||
;
|
||||
; Entrypoint
|
||||
;
|
||||
kstart:
|
||||
mov esp, KERNEL_STACK+KERNEL_STACKSIZE ;Create kernel stack
|
||||
push eax ;Multiboot magic number
|
||||
push ebx ;Multiboot info
|
||||
call kmain ;Call kernel entrypoint
|
||||
cli ;Clear interrupts
|
||||
hlt ;Halt machine
|
||||
|
||||
section .bss
|
||||
|
||||
;
|
||||
; Kernel stack location
|
||||
;
|
||||
align 32
|
||||
KERNEL_STACK:
|
||||
resb KERNEL_STACKSIZE
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user