2020-07-04 10:35:38 +02:00
|
|
|
cpu 8086
|
2020-09-15 21:44:32 +02:00
|
|
|
org 0x7C00
|
2020-04-15 00:17:58 +02:00
|
|
|
|
2020-07-04 10:35:38 +02:00
|
|
|
%include "inc/bpb.asm"
|
2020-09-15 21:44:32 +02:00
|
|
|
%include "inc/mbr.asm"
|
2020-04-15 00:17:58 +02:00
|
|
|
|
2020-09-15 21:44:32 +02:00
|
|
|
; kernel stack size in words
|
|
|
|
%define stacksize 512
|
2020-08-31 22:11:05 +02:00
|
|
|
|
2020-09-17 07:57:46 +02:00
|
|
|
jmp near init
|
2020-08-31 22:11:05 +02:00
|
|
|
|
2020-09-17 10:59:22 +02:00
|
|
|
%defstr STRVER VERSION
|
|
|
|
%define INTVER 0x %+ VERSION
|
|
|
|
|
|
|
|
db STRVER
|
2020-08-31 22:11:05 +02:00
|
|
|
|
2020-09-17 07:57:46 +02:00
|
|
|
; mformat writes stuff until 0x3E
|
|
|
|
params: times ( 0x3E - ($-$$) ) nop
|
2020-04-26 23:14:34 +02:00
|
|
|
|
2020-07-04 10:35:38 +02:00
|
|
|
init: cli
|
|
|
|
xor ax, ax
|
|
|
|
mov ds, ax
|
|
|
|
mov es, ax
|
|
|
|
mov ss, ax
|
|
|
|
mov sp, ( stack+stacksize )
|
2020-04-26 23:14:34 +02:00
|
|
|
|
2020-09-17 07:57:46 +02:00
|
|
|
mov ax, [params+bpb.sectoroffset]
|
|
|
|
mov dx, [params+bpb.sectoroffset+2]
|
|
|
|
|
|
|
|
mov ax, 0x0201
|
|
|
|
mov cx, 0x0002
|
|
|
|
mov dh, 0
|
|
|
|
mov bx, 0x7E00
|
|
|
|
int 0x13
|
|
|
|
|
|
|
|
mov ax, [0x7E00]
|
|
|
|
mov cx, [0x7E02]
|
|
|
|
mov dx, [0x7E04]
|
|
|
|
|
2020-08-27 22:52:16 +02:00
|
|
|
int 3
|
|
|
|
|
2020-09-15 21:44:32 +02:00
|
|
|
hlt: hlt
|
|
|
|
jmp hlt
|
2020-04-20 19:13:06 +02:00
|
|
|
|
2020-09-17 07:57:46 +02:00
|
|
|
times (0x1FE - ($-$$)) db 0
|
|
|
|
dw 0xAA55
|
|
|
|
|
|
|
|
db "rdos kernel"
|
|
|
|
|
2020-09-17 10:59:22 +02:00
|
|
|
dd INTVER
|
|
|
|
|
2020-09-17 07:57:46 +02:00
|
|
|
end: align 512
|
|
|
|
|
2020-04-23 21:36:20 +02:00
|
|
|
section .bss
|
2020-09-15 21:44:32 +02:00
|
|
|
|
|
|
|
stack: resb stacksize
|