2019-04-20 23:02:35 +02:00
|
|
|
cpu 8086
|
|
|
|
org 0x0000
|
2019-04-29 00:01:30 +02:00
|
|
|
db 0x55, 0xAA
|
|
|
|
optrom_length:
|
|
|
|
db 0x00
|
2019-04-20 23:02:35 +02:00
|
|
|
jmp optrom_init
|
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
str_vendor:
|
|
|
|
db "Nero", 0
|
|
|
|
|
|
|
|
align 16
|
|
|
|
str_product:
|
|
|
|
db "Nero DOS", 0
|
|
|
|
|
2019-04-20 23:02:35 +02:00
|
|
|
times (0x1A - ($-$$)) db 0
|
|
|
|
dw pnp
|
|
|
|
|
|
|
|
align 16
|
|
|
|
pnp:
|
|
|
|
db "$PnP"
|
|
|
|
db 1 ; version 1
|
|
|
|
db 2 ; 2 * 16 length
|
|
|
|
dw 0 ; offset of next header
|
|
|
|
db 0
|
|
|
|
db 0 ; checksum (filled by fix-rom)
|
|
|
|
dd 0 ; device identifier
|
2019-04-29 00:01:30 +02:00
|
|
|
dw str_vendor ; manufacturer string
|
|
|
|
dw str_product ; product name string
|
2019-04-20 23:02:35 +02:00
|
|
|
db 0,0,0 ; device type string
|
|
|
|
db 0x20 ; device indicator, bit for "read cacheable" set
|
|
|
|
dw 0 ; boot connection vector
|
|
|
|
dw 0 ; boot disconnect vector
|
|
|
|
dw start ; bootstrap entry point
|
|
|
|
dw 0 ; reserved
|
|
|
|
dw 0
|
|
|
|
|
|
|
|
align 16
|
|
|
|
optrom_init:
|
|
|
|
xor ax, ax
|
|
|
|
mov es, ax
|
|
|
|
mov di, 0x0060 ; vector (0x18 * 4 bytes)
|
|
|
|
mov ax, start
|
|
|
|
stosw
|
|
|
|
mov ax, cs
|
|
|
|
stosw
|
|
|
|
retf
|
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
putc:
|
2019-04-20 23:02:35 +02:00
|
|
|
push bx
|
2019-04-29 00:01:30 +02:00
|
|
|
push cx
|
|
|
|
mov ah, 0x0e
|
2019-04-20 23:02:35 +02:00
|
|
|
mov bx, 0x0000
|
|
|
|
int 0x10
|
2019-04-29 00:01:30 +02:00
|
|
|
pop cx
|
2019-04-20 23:02:35 +02:00
|
|
|
pop bx
|
2019-04-29 00:01:30 +02:00
|
|
|
ret
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
announce:
|
|
|
|
push cs
|
|
|
|
mov ax, str_product
|
|
|
|
push ax
|
|
|
|
call printf
|
|
|
|
db "%S (CS=%Xh)", 0x0A, 0x0D, 0x00
|
|
|
|
add sp, 4
|
|
|
|
ret
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
start:
|
|
|
|
mov ax, cs
|
|
|
|
mov ds, ax
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
call announce
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
; clear memory until 0x01000
|
|
|
|
xor ax, ax
|
|
|
|
mov es, ax
|
|
|
|
mov di, 0x500
|
|
|
|
mov cx, 0xB00
|
|
|
|
rep stosb
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
call intr_init
|
|
|
|
sti
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
sub sp, 0x10
|
|
|
|
mov si, sp
|
|
|
|
mov word [ss:si+0x00], 0
|
|
|
|
mov word [ss:si+0x02], 1
|
|
|
|
mov word [ss:si+0x04], 0
|
|
|
|
mov word [ss:si+0x06], 0x2000
|
|
|
|
mov word [ss:si+0x08], 0x07fc
|
|
|
|
mov word [ss:si+0x0A], 0
|
|
|
|
mov word [ss:si+0x0C], 0
|
|
|
|
mov word [ss:si+0x0E], 0
|
|
|
|
mov ah, 0x42
|
|
|
|
|
|
|
|
push ss
|
|
|
|
pop ds
|
|
|
|
call ramdisk_io
|
|
|
|
push ax
|
|
|
|
call printf
|
|
|
|
db "AX=%X", 0x0A, 0x0D, 0x00
|
|
|
|
pop ax
|
|
|
|
|
|
|
|
add sp, 0x10
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
.halt:
|
|
|
|
hlt
|
|
|
|
jmp .halt
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
%include "ramdisk.inc"
|
|
|
|
%include "printf.inc"
|
2019-04-20 23:02:35 +02:00
|
|
|
|
|
|
|
%include "intr.asm"
|
|
|
|
%include "debug.asm"
|
|
|
|
%include "kprintf.asm"
|
|
|
|
%include "dosapi.asm"
|
|
|
|
|
|
|
|
_reloc_end:
|
|
|
|
|
|
|
|
align 512
|