WonderWitch/FreyaBIOS/System: Difference between revisions
From WSdev Wiki
Jump to navigationJump to search
Line 55: | Line 55: | ||
* AH = $0B | * AH = $0B | ||
* AL = Suspend slot (see below) | * AL = Suspend slot (see below) | ||
* DS:BX = | * DS:BX = Pointer to I/O resume table (see below) | ||
Return: | Return: |
Revision as of 09:09, 15 December 2024
The System interrupt provides assorted system-related functionality.
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
- AH = $0B
- AL = Suspend slot (see below)
- DS:BX = Pointer to I/O resume table (see below)
Return:
- AX = 0 if suspend successful, 1 if returning from suspend (via sys_resume).
Makes a copy of the execution state (IRAM, I/O ports, stack) to be restored via sys_resume (see below).
Suspend/resume structure
This structure is stored in SRAM block 3, offset $7E00
(slot 1) and $BF00
(slot 0).
Offset | Size | Contents |
---|---|---|
$0000 | 16384 | Copy of RAM area $0000 - $3FFF
|
$4000 | 4 | Far pointer to I/O resume table (DS:BX), plus 1 |
$4004 | 224 | Copy of IO ports $00 - $DF
|
$40E4 | 2 | Value of CX? |
$40E6 | 2 | Value of SP? |
$40E8 | 2 | Value of SS? |
I/O resume table
Offset | Size | Contents |
---|---|---|
$00 | 2 | 'IO' |
$02 | 224 | Resume configuration for each I/O port |
INT $17/AH=$0C - sys_resume
- AH = $0C
- AL = Suspend slot?
Resumes execution from an existing suspend slot. Returns to where sys_suspend was last called, but with a different return value.
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