diff --git a/src/interrupts.s b/src/interrupts.s index e08fa20..94e1876 100644 --- a/src/interrupts.s +++ b/src/interrupts.s @@ -155,6 +155,20 @@ cop_handler_native: cop_jump_table: .word .word0 cop_exit .word .word0 cop_get_version + .word .word0 cop_console_input + .word .word0 cop_console_output + .word .word0 cop_console_print_string + .word .word0 cop_console_read_line + .word .word0 cop_console_status + .word .word0 cop_volume_select + .word .word0 cop_volume_query + .word .word0 cop_volume_current + .word .word0 cop_get_date + .word .word0 cop_set_date + .word .word0 cop_get_time + .word .word0 cop_set_time + .word .word0 cop_sector_read + .word .word0 cop_sector_write ; ----------------------------------------------------------------------------- ; Function 0: Exit @@ -190,3 +204,236 @@ cop_get_version: cop_rti ; ----------------------------------------------------------------------------- +; Function 2: Console Input +; +; If there is no character waiting in standard input, then wait for one. Take +; the character from stdin, and send it to stdout. Return the character value +; in A. +; +; Arguments: None +; Return Value: +; A: Input character + +cop_console_input: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 3: Console Output +; +; The character in A is written to standard output. +; +; Arguments: +; A: Character to write to stdout +; Return Value: None +cop_console_output: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 4: Print String +; +; Prints a NULL-terminated string to stdout. +; +; Arguments: +; A: String bank +; Y: String address +; Return Value: None + +cop_console_print_string: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 5: Read Input Line +; +; Reads a line of characters from standard input, storing the resulting string +; (terminated with NULL, CR not included) in the provided memory buffer. +; +; Arguments: +; A: Buffer bank +; Y: Buffer address +; Return Value: +; A: Length of line read (including terminating NULL) + +cop_console_read_line: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 6: Console Status +; +; Checks if a character is available to be read from standard input. +; +; Arguments: None +; Return Value: +; A: Zero if no character available, nonzero otherwise. + +cop_console_status: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 7: Select Volume +; +; Sets the selected volume to the one whose logical number is in A. +; +; Arguments: +; A: Logical number to select as the selected volume. +; Return Value: +; A: Zero on success. Error code on failure. + +cop_volume_select: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 8: Query Volumes +; +; Returns a bitmap of the active (available) volume numbers in C. +; Bit 0 refers to logical volume 0, bit 1 to logical volume 1, etc. +; +; Arguments: None +; Return Value: +; C: Bitmap of active logical volumes. + +cop_volume_query: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 9: Get Current Volume +; +; Returns the logical volume ID of the currently selected volume. +; +; Arguments: None +; Return Value: +; A: Logical volume ID of the current volume. + +cop_volume_current: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 10: Get Date +; +; Gets the current date into a structure with the following format: +; struct date_s { +; uint16_t year; +; uint8_t month; +; uint8_t day; +; }; +; +; If a compatible realtime clock is installed, it will be used as the source +; for the date; otherwise, internal kernel variables will be used, updated by +; the system timer. +; +; Arguments: +; A: Bank of argument address +; Y: Argument address +; Return Value: None + +cop_get_date: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 11: Set Date +; +; Sets the current date from a structure with the following format: +; struct date_s { +; uint16_t year; +; uint8_t month; +; uint8_t day; +; }; +; +; If a compatible realtime clock is installed, it will be used as the destination +; for the date; otherwise, internal kernel variables will be used, updated by +; the system timer. +; +; Arguments: +; A: Bank of argument address +; Y: Argument address +; Return Value: None + +cop_set_date: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 12: Get Time +; +; Gets the current time into a structure with the following format: +; struct time_s { +; uint8_t millisecond; +; uint8_t second; +; uint8_t minute; +; uint8_t hour; +; }; +; +; If a compatible realtime clock is installed, it will be used as the source +; for the time; otherwise, internal kernel variables will be used, updated by +; the system timer. +; +; Arguments: +; A: Bank of argument address +; Y: Argument address +; Return Value: None + +cop_get_time: + cop_rti + +; ----------------------------------------------------------------------------- +; Function 13: Set Time +; +; Gets the current time into a structure with the following format: +; struct time_s { +; uint8_t millisecond; +; uint8_t second; +; uint8_t minute; +; uint8_t hour; +; }; +; +; If a compatible realtime clock is installed, it will be used as the destination +; for the date; otherwise, internal kernel variables will be used, updated by +; the system timer. +; +; Arguments: +; A: Bank of argument address +; Y: Argument address +; Return Value: None + +cop_set_time: + cop_rti + + +; ----------------------------------------------------------------------------- +; Function 14: Read Sectors +; +; Read a number of sectors from the specified physical device. Arguments are +; provided in a structure with the following format: +; struct sector_read_s { +; uint8_t device; +; uint32_t first_sector; +; uint8_t length; +; void *dest; +; }; +; +; Arguments: +; C: Bank of argument address +; Y: Argument address +; Return Value: Error code + +cop_sector_read: + cop_rti + + +; ----------------------------------------------------------------------------- +; Function 15: Write Sectors +; +; Write a number of sectors to the specified physical device. Arguments are +; provided in a structure with the following format: +; struct sector_write_s { +; uint8_t device; +; uint32_t first_sector; +; uint8_t length; +; void *src; +; }; +; +; Arguments: +; C: Bank of argument address +; Y: Argument address +; Return Value: Error code + +cop_sector_write: + cop_rti