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-08-31 00:18:05 +02:00
|
|
|
; reserved area
|
2019-04-20 23:02:35 +02:00
|
|
|
times (0x1A - ($-$$)) db 0
|
|
|
|
dw pnp
|
|
|
|
|
|
|
|
align 16
|
|
|
|
pnp:
|
|
|
|
db "$PnP"
|
2019-08-31 00:18:05 +02:00
|
|
|
.version:
|
2019-04-20 23:02:35 +02:00
|
|
|
db 1 ; version 1
|
2019-08-31 00:18:05 +02:00
|
|
|
.length:
|
2019-04-20 23:02:35 +02:00
|
|
|
db 2 ; 2 * 16 length
|
|
|
|
dw 0 ; offset of next header
|
|
|
|
db 0
|
2019-08-31 00:18:05 +02:00
|
|
|
.checksum:
|
2019-04-20 23:02:35 +02:00
|
|
|
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
|
|
|
|
|
2019-05-02 22:25:50 +02:00
|
|
|
str_vendor:
|
|
|
|
db "Nero", 0
|
|
|
|
str_product:
|
|
|
|
db "Nero DOS ", 60, 234, 62, 0
|
|
|
|
|
2019-04-20 23:02:35 +02:00
|
|
|
optrom_init:
|
2019-09-01 15:48:28 +02:00
|
|
|
push cs
|
|
|
|
pop es
|
2019-09-01 16:16:47 +02:00
|
|
|
|
|
|
|
mov di, isr_debug
|
|
|
|
mov ax, 0x1
|
|
|
|
call intr_register
|
|
|
|
mov ax, 0x3
|
|
|
|
call intr_register
|
|
|
|
|
2019-09-01 15:48:28 +02:00
|
|
|
mov di, start
|
|
|
|
mov ax, 0x18
|
2019-05-02 22:14:31 +02:00
|
|
|
call intr_register
|
2019-09-01 16:16:47 +02:00
|
|
|
|
2019-04-20 23:02:35 +02:00
|
|
|
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:
|
2019-05-02 22:26:11 +02:00
|
|
|
push ds
|
2019-04-29 00:01:30 +02:00
|
|
|
push cs
|
2019-09-03 12:58:06 +02:00
|
|
|
push cs
|
|
|
|
pop ds
|
2019-04-29 00:01:30 +02:00
|
|
|
mov ax, str_product
|
|
|
|
push ax
|
|
|
|
call printf
|
|
|
|
db "%S (CS=%Xh)", 0x0A, 0x0D, 0x00
|
|
|
|
add sp, 4
|
2019-05-02 22:26:11 +02:00
|
|
|
pop ds
|
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
|
|
|
start:
|
2019-05-02 22:14:31 +02:00
|
|
|
xor ax, ax
|
2019-04-29 00:01:30 +02:00
|
|
|
mov ds, ax
|
2019-05-02 22:14:31 +02:00
|
|
|
mov es, ax
|
|
|
|
mov ss, ax
|
2019-09-01 15:46:48 +02:00
|
|
|
mov sp, 0x800
|
|
|
|
mov di, sp
|
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-09-03 12:58:06 +02:00
|
|
|
call drvtab_create
|
|
|
|
|
|
|
|
int3
|
|
|
|
|
2019-08-31 00:18:05 +02:00
|
|
|
cli
|
2019-04-29 00:01:30 +02:00
|
|
|
.halt:
|
|
|
|
hlt
|
|
|
|
jmp .halt
|
2019-04-20 23:02:35 +02:00
|
|
|
|
2019-09-03 12:58:06 +02:00
|
|
|
%include "intr.asm"
|
|
|
|
%include "drvtab.asm"
|
|
|
|
|
2019-04-29 00:01:30 +02:00
|
|
|
%include "printf.inc"
|
2019-08-31 00:18:05 +02:00
|
|
|
%include "print.asm"
|
|
|
|
|
2019-04-20 23:02:35 +02:00
|
|
|
%include "debug.asm"
|
|
|
|
|
2019-08-30 19:40:47 +02:00
|
|
|
align 512
|