WonderWitch/FreyaBIOS/System: Difference between revisions
From WSdev Wiki
Jump to navigationJump to search
(Created page with "The System interrupt provides assorted system-related functionality. == Types == === Suspend/resume structure === This structure is stored in SRAM block 3, offset <code>$7E00</code> (core 1) and <code>$BF00</code> (core 0). {| class="wikitable" |- ! Offset !! Size !! Contents |- | $0000 || 16384 || Copy of RAM area <code>$0000</code> - <code>$3FFF</code> |- | $4000 || 2 || Stack segment? |- | $4002 || 2 || Data segment? |- | $4004 || 224 || Copy of IO ports <code>$00...") |
(→Interrupts: start) |
||
Line 24: | Line 24: | ||
== Interrupts == | == Interrupts == | ||
=== INT $17/AH=$00 - sys_interrupt_set_hook === | |||
* AH = $00 | |||
* AL = Interrupt index | |||
* DS:BX = Pointer to new vector (read from) | |||
* DS:DX = Pointer to old vector (written to) | |||
=== INT $17/AH=$01 - sys_interrupt_reset_hook === | |||
* AH = $01 | |||
* AL = Interrupt index | |||
* DS:BX = Pointer to old vector (read from) | |||
=== INT $17/AH=$02 - sys_wait === | |||
* AH = $02 | |||
* CX = Frames to wait | |||
=== INT $17/AH=$03 - sys_get_tick_count === | |||
* AH = $03 | |||
Return: | |||
* DX:AX = Number of frames since system start | |||
=== INT $17/AH=$04 - sys_sleep === | |||
=== INT $17/AH=$05 - sys_set_sleep_time === | |||
=== INT $17/AH=$06 - sys_get_sleep_time === | |||
=== INT $17/AH=$07 - sys_set_awake_key === | |||
=== INT $17/AH=$08 - sys_get_awake_key === | |||
=== INT $17/AH=$09 - sys_set_keepalive_int === | |||
=== INT $17/AH=$0A - sys_get_ownerinfo === | |||
* AH = $0A | |||
* DS:DX = Output buffer | |||
* CX = Output buffer size, in bytes | |||
Errata: | |||
* The FreyaBIOS implementation only works correctly in the "mono" mode. An alternate implementation that supports "color" mode is provided as part of libwwc. | |||
=== INT $17/AH=$0B - sys_suspend === | |||
=== INT $17/AH=$0C - sys_resume === | |||
=== INT $17/AH=$0D - sys_set_remote === | |||
=== INT $17/AH=$0E - sys_get_remote === | |||
=== INT $17/AH=$0F - sys_alloc_iram === | |||
=== INT $17/AH=$10 - sys_free_iram === | |||
=== INT $17/AH=$11 - sys_get_my_iram === | |||
=== INT $17/AH=$12 - sys_get_version === | |||
* AH = $12 | |||
Return: | |||
* AX = BIOS version | |||
=== INT $17/AH=$13 - sys_swap === | |||
=== INT $17/AH=$14 - sys_set_resume === | |||
=== INT $17/AH=$15 - sys_get_resume === |
Revision as of 09:44, 8 December 2024
The System interrupt provides assorted system-related functionality.
Types
Suspend/resume structure
This structure is stored in SRAM block 3, offset $7E00
(core 1) and $BF00
(core 0).
Offset | Size | Contents |
---|---|---|
$0000 | 16384 | Copy of RAM area $0000 - $3FFF
|
$4000 | 2 | Stack segment? |
$4002 | 2 | Data segment? |
$4004 | 224 | Copy of IO ports $00 - $DF
|
$40E4 | 6 | ? |
Interrupts
INT $17/AH=$00 - sys_interrupt_set_hook
- AH = $00
- AL = Interrupt index
- DS:BX = Pointer to new vector (read from)
- DS:DX = Pointer to old vector (written to)
INT $17/AH=$01 - sys_interrupt_reset_hook
- AH = $01
- AL = Interrupt index
- DS:BX = Pointer to old vector (read from)
INT $17/AH=$02 - sys_wait
- AH = $02
- CX = Frames to wait
INT $17/AH=$03 - sys_get_tick_count
- AH = $03
Return:
- DX:AX = Number of frames since system start
INT $17/AH=$04 - sys_sleep
INT $17/AH=$05 - sys_set_sleep_time
INT $17/AH=$06 - sys_get_sleep_time
INT $17/AH=$07 - sys_set_awake_key
INT $17/AH=$08 - sys_get_awake_key
INT $17/AH=$09 - sys_set_keepalive_int
INT $17/AH=$0A - sys_get_ownerinfo
- AH = $0A
- DS:DX = Output buffer
- CX = Output buffer size, in bytes
Errata:
- The FreyaBIOS implementation only works correctly in the "mono" mode. An alternate implementation that supports "color" mode is provided as part of libwwc.
INT $17/AH=$0B - sys_suspend
INT $17/AH=$0C - sys_resume
INT $17/AH=$0D - sys_set_remote
INT $17/AH=$0E - sys_get_remote
INT $17/AH=$0F - sys_alloc_iram
INT $17/AH=$10 - sys_free_iram
INT $17/AH=$11 - sys_get_my_iram
INT $17/AH=$12 - sys_get_version
- AH = $12
Return:
- AX = BIOS version