83 lines
1.6 KiB
Text
83 lines
1.6 KiB
Text
.load 0x1740
|
|
.entry _drake_bootsector_entry_point
|
|
|
|
@include <../bios_api.dss>
|
|
@include <palette.dss>
|
|
|
|
|
|
|
|
.data
|
|
$string "Hello "
|
|
$ddd <DiskDriverData>
|
|
$dpt_block <DPTBlock>
|
|
$textCell <Text16VModeCell>
|
|
|
|
|
|
.code
|
|
|
|
|
|
_drake_bootsector_entry_point:
|
|
push $ddd
|
|
push $dpt_block
|
|
push 2
|
|
call $_load_dpt_block
|
|
|
|
movb [VGA_Registers.VIDEO_MODE], VGA_VideoModes.TEXT_16_COLORS
|
|
|
|
push 2
|
|
push 1
|
|
push 2
|
|
call $_draw_palette
|
|
|
|
|
|
|
|
movb [$textCell.CoordX], 2
|
|
movb [$textCell.CoordY], 2
|
|
movb [$textCell.Foreground], DefaultPalette.Orange
|
|
movb [$textCell.Background], DefaultPalette.Black
|
|
|
|
mov R10, 0x22
|
|
mov R8, $string
|
|
mov R9, $textCell
|
|
int 0x30
|
|
|
|
|
|
movb [$textCell.CoordX], 8
|
|
movb [$textCell.CoordY], 2
|
|
movb [$textCell.Foreground], DefaultPalette.Black
|
|
movb [$textCell.Background], DefaultPalette.Orange
|
|
|
|
mov R10, 0x22
|
|
mov R8, { $dpt_block + DPTStructure.ENTRIES_START + (2 * DPTStructure.ENTRY_SIZE_B) + DPTStructure.ENTRY_PART_LBL }
|
|
mov R9, $textCell
|
|
int 0x30
|
|
|
|
|
|
|
|
hlt
|
|
|
|
|
|
|
|
_load_dpt_block: ## _load_dpt_block(DiskDriverData* ddd, DPTBlock* dpt_block)
|
|
arg R1 ## @Param: ddd
|
|
arg R2 ## @Param: dpt_block
|
|
mov R3, R1 ## Copy $ddd address into R3
|
|
movb *R1, DiskMode.READ ## $ddd.Mode
|
|
inc R1
|
|
movb *R1, 0x00 ## $ddd.Disk
|
|
inc R1
|
|
mov *R1, 0x0000 ## $ddd.Sector
|
|
addip R1, 2
|
|
mov *R1, 0x0200 ## $ddd.Address
|
|
addip R1, 2
|
|
mov *R1, 512 ## $ddd.DataSize
|
|
addip R1, 2
|
|
mov *R1, R2 ## $ddd.MemoryAddress
|
|
mov R9, R3 ## Move original $ddd address into R9 (for int 0x20)
|
|
mov R10, 0x12 ## int 0x20 parameter for load_from_ddd_blocking
|
|
int 0x20 ## Bios interrupt
|
|
ret
|
|
|
|
|
|
.fixed 5120, 0xFF
|
|
|