kernel: relocate to HMA if available
This commit is contained in:
parent
fa6e624604
commit
517c156c3d
3 changed files with 45 additions and 41 deletions
|
@ -4,55 +4,27 @@ org 0x0000
|
|||
|
||||
_startup:
|
||||
mov ax, cs
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov ss, ax
|
||||
mov sp, 0x0000
|
||||
; <0x0010 is BIOS segment when relocated to HMA
|
||||
; so we need a nop sled
|
||||
times (0x10 - ($-$$)) nop
|
||||
main:
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
mov si, ax
|
||||
mov cx, ax
|
||||
|
||||
call debug_init
|
||||
int 0x2E
|
||||
|
||||
call hma_relocate
|
||||
call ivt_backup
|
||||
call debug_init
|
||||
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
xor cx, cx
|
||||
mov si, ax
|
||||
.loop:
|
||||
mov ax, cx
|
||||
call kprint8
|
||||
mov al, '='
|
||||
call kputc
|
||||
lodsw
|
||||
xchg ax, dx
|
||||
lodsw
|
||||
int 0x2E
|
||||
mov ax,0x1234
|
||||
int 0x2E
|
||||
call kprint16
|
||||
mov al, ':'
|
||||
call kputc
|
||||
xchg ax, dx
|
||||
call kprint16
|
||||
mov al, ' '
|
||||
call kputc
|
||||
inc cx
|
||||
test cx, 0x0003
|
||||
jnz .loop
|
||||
mov al, 0x0A
|
||||
call kputc
|
||||
mov al, 0x0D
|
||||
call kputc
|
||||
cmp cx, 0x0060
|
||||
jl .loop
|
||||
|
||||
.halt:
|
||||
hlt
|
||||
jmp .halt
|
||||
|
||||
%include "hma.asm"
|
||||
|
||||
%include "heap.asm"
|
||||
%include "intr.asm"
|
||||
%include "debug.asm"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue