DragonVM/extra/dss/drake/entry.dss

61 lines
1.7 KiB
Text

.load 0x1380
@include <../bios_api.dss>
.data
$_drake_logo_line_1 " ___ ___ ___ __ ______"
$_drake_logo_line_2 " / _ \/ _ \/ _ | / //_/ __/"
$_drake_logo_line_3 " / // / , _/ __ |/ ,< / _/ "
$_drake_logo_line_4 "/____/_/|_/_/ |_/_/|_/___/ "
$_logo_padding " "
.code
mov R10, 0xE0
int 0x30
push 0
call $_print_logo
and FL, 0b1111111111111110 ## Disable interrupts
mov FL, ACC
push 0
call $_load_boot_sector
or FL, 0b0000000000000001 ## Enable interrupts
mov FL, ACC
jmp MemoryAddresses.RAM
_infinite_loop:
jmp $_infinite_loop
hlt
_print_logo:
mov R5, $_drake_logo_line_1
mov R6, 0
mov ACC, 6
_print_logo_loop:
mov R10, 0x0C
inc R6
mov R9, $_logo_padding
int 0x30
mov R9, R5
int 0x30
mov R10, 0x02
int 0x30
addip R5, 29
jls $_print_logo_loop, R6
ret
_load_boot_sector:
movb [{MemoryAddresses.DISK_INTERFACE + 0x1}], 0x00 ## Mode = Read
movb R1, [{ MemoryAddresses.CMOS + 0x10 }]
movb [{MemoryAddresses.DISK_INTERFACE + 0x2}], R1 ## Disk = Default
mov [{MemoryAddresses.DISK_INTERFACE + 0x3}],0x0000 ## Sector
mov [{MemoryAddresses.DISK_INTERFACE + 0x5}],0x0400 ## Address
mov [{MemoryAddresses.DISK_INTERFACE + 0x7}], 1024 ## Size
mov [{MemoryAddresses.DISK_INTERFACE + 0x9}], MemoryAddresses.RAM ## MemoryAddress
movb [MemoryAddresses.DISK_INTERFACE], 0x00 ## Signal = Start
_load_boot_sector_block_wait_loop:
mov ACC, [{MemoryAddresses.DISK_INTERFACE + 0xB}] ## Moving <Status> register into ACC
jne $_load_boot_sector_block_wait_loop, 0x00 ## If <Status> register not Free, loop around and wait
ret
.fixed 512, 0x00