KallistiOS
##version##
|
Dreamcast architecture specific options. More...
Go to the source code of this file.
Macros | |
#define | PAGESIZE 4096 |
Page size (for MMU) More... | |
#define | PAGESIZE_BITS 12 |
Bits for page size. More... | |
#define | PAGEMASK (PAGESIZE - 1) |
Mask for page offset. More... | |
#define | page_count ((16*1024*1024 - 0x10000) / PAGESIZE) |
Page count "variable". More... | |
#define | page_phys_base 0x8c010000 |
Base address of available physical pages. More... | |
#define | HZ 100 |
Number of timer ticks per second. More... | |
#define | THD_STACK_SIZE 32768 |
Default thread stack size. More... | |
#define | DEFAULT_VID_MODE DM_640x480 |
Default video mode. More... | |
#define | DEFAULT_PIXEL_MODE PM_RGB565 |
Default pixel mode for video. More... | |
#define | DEFAULT_SERIAL_BAUD 57600 |
Default serial bitrate. More... | |
#define | DEFAULT_SERIAL_FIFO 1 |
Default serial FIFO behavior. More... | |
#define | ELF_SYM_PREFIX "_" |
Global symbol prefix in ELF files. More... | |
#define | ELF_SYM_PREFIX_LEN 1 |
Length of global symbol prefix in ELF files. More... | |
#define | ARCH_EXIT_RETURN 1 |
Return to loader. More... | |
#define | ARCH_EXIT_MENU 2 |
Return to system menu. More... | |
#define | ARCH_EXIT_REBOOT 3 |
Reboot the machine. More... | |
#define | KOS_INIT_FLAGS(flags) uint32 __kos_init_flags = (flags) |
Use this macro to determine the level of initialization you'd like in your program by default. More... | |
#define | KOS_INIT_ROMDISK(rd) void * __kos_romdisk = (rd) |
Define a romdisk for your program, if you'd like one. More... | |
#define | KOS_INIT_ROMDISK_NONE NULL |
State that you don't want a romdisk. More... | |
#define | INIT_DEFAULT (INIT_IRQ | INIT_THD_PREEMPT) |
Default init flags (IRQs on, preemption enabled). More... | |
#define | INIT_NONE 0x0000 |
Don't init optional things. More... | |
#define | INIT_IRQ 0x0001 |
Enable IRQs at startup. More... | |
#define | INIT_THD_PREEMPT 0x0002 |
Enable thread preemption. More... | |
#define | INIT_NET 0x0004 |
Enable built-in networking. More... | |
#define | INIT_MALLOCSTATS 0x0008 |
Enable malloc statistics. More... | |
#define | INIT_QUIET 0x0010 |
Disable dbgio. More... | |
#define | INIT_OCRAM 0x10000 |
Use half of the dcache as RAM. More... | |
#define | INIT_NO_DCLOAD 0x20000 |
Disable dcload. More... | |
#define | HW_TYPE_RETAIL 0x0 |
A retail Dreamcast. More... | |
#define | HW_TYPE_SET5 0x9 |
A Set5.xx devkit. More... | |
#define | HW_REGION_UNKNOWN 0x0 |
Unknown region. More... | |
#define | HW_REGION_ASIA 0x1 |
Japan/Asia (NTSC) More... | |
#define | HW_REGION_US 0x4 |
North America. More... | |
#define | HW_REGION_EUROPE 0xC |
Europe (PAL) More... | |
#define | arch_sleep() |
Dreamcast specific sleep mode "function". More... | |
#define | arch_get_ret_addr() |
DC specific "function" to get the return address from the current function. More... | |
#define | arch_get_fptr() |
DC specific "function" to get the frame pointer from the current function. More... | |
#define | arch_fptr_ret_addr(fptr) (*((uint32*)fptr)) |
Pass in a frame pointer value to get the return address for the given frame. More... | |
#define | arch_fptr_next(fptr) (*((uint32*)(fptr+4))) |
Pass in a frame pointer value to get the previous frame pointer for the given frame. More... | |
#define | arch_valid_address(ptr) ((ptr_t)(ptr) >= 0x8c010000 && (ptr_t)(ptr) < 0x8d000000) |
Returns true if the passed address is likely to be valid. Doesn't have to be exact, just a sort of general idea. More... | |
Functions | |
void | panic (const char *str) __noreturn |
Panic function. More... | |
int | arch_main () |
Kernel C-level entry point. More... | |
void | arch_set_exit_path (int path) |
Set the exit path. More... | |
void | arch_exit () __noreturn |
Generic kernel "exit" point. More... | |
void | arch_return () __noreturn |
Kernel "return" point. More... | |
void | arch_abort () __noreturn |
Kernel "abort" point. More... | |
void | arch_reboot () __noreturn |
Kernel "reboot" call. More... | |
void | arch_menu () __noreturn |
Kernel "exit to menu" call. More... | |
void | arch_ctors () |
Call to run all ctors. More... | |
void | arch_dtors () |
Call to run all dtors. More... | |
void | __crtend_pullin () |
Hook to ensure linking of crtend.c. More... | |
int | mm_init () |
Initialize the memory management system. More... | |
void * | mm_sbrk (unsigned long increment) |
Request more core memory from the system. More... | |
void | arch_real_exit () __noreturn |
Jump back to the bootloader. More... | |
int | hardware_sys_init () |
Initialize bare-bones hardware systems. More... | |
int | hardware_periph_init () |
Initialize some peripheral systems. More... | |
void | hardware_shutdown () |
Shut down hardware that was initted. More... | |
int | hardware_sys_mode (int *region) |
Retrieve the system mode of the console in use. More... | |
const char * | kos_get_banner (void) |
Retrieve the banner printed at program initialization. More... | |
const char * | kos_get_license (void) |
Retrieve the license information for the compiled copy of KOS. More... | |
const char * | kos_get_authors (void) |
Retrieve a list of authors and the dates of their contributions. More... | |
Variables | |
uint32 | __kos_init_flags |
The init flags. Do not modify this directly! More... | |
void * | __kos_romdisk |
Built-in romdisk. Do not modify this directly! More... | |
Dreamcast architecture specific options.
This file has various architecture specific options defined in it. Also, any functions that start with arch_ are in here.
#define arch_fptr_next | ( | fptr | ) | (*((uint32*)(fptr+4))) |
Pass in a frame pointer value to get the previous frame pointer for the given frame.
fptr | The frame pointer to look at. |
#define arch_fptr_ret_addr | ( | fptr | ) | (*((uint32*)fptr)) |
Pass in a frame pointer value to get the return address for the given frame.
fptr | The frame pointer to look at. |
#define arch_get_fptr | ( | ) |
DC specific "function" to get the frame pointer from the current function.
#define arch_get_ret_addr | ( | ) |
#define arch_sleep | ( | ) |
Dreamcast specific sleep mode "function".
#define arch_valid_address | ( | ptr | ) | ((ptr_t)(ptr) >= 0x8c010000 && (ptr_t)(ptr) < 0x8d000000) |
Returns true if the passed address is likely to be valid. Doesn't have to be exact, just a sort of general idea.
#define DEFAULT_PIXEL_MODE PM_RGB565 |
Default pixel mode for video.
#define DEFAULT_SERIAL_BAUD 57600 |
Default serial bitrate.
#define DEFAULT_SERIAL_FIFO 1 |
Default serial FIFO behavior.
#define DEFAULT_VID_MODE DM_640x480 |
Default video mode.
#define ELF_SYM_PREFIX "_" |
Global symbol prefix in ELF files.
#define ELF_SYM_PREFIX_LEN 1 |
Length of global symbol prefix in ELF files.
#define HZ 100 |
Number of timer ticks per second.
#define KOS_INIT_FLAGS | ( | flags | ) | uint32 __kos_init_flags = (flags) |
Use this macro to determine the level of initialization you'd like in your program by default.
The defaults line will be fine for most things.
flags | Parts of KOS to init. |
#define KOS_INIT_ROMDISK | ( | rd | ) | void * __kos_romdisk = (rd) |
Define a romdisk for your program, if you'd like one.
rd | Pointer to the romdisk image in your code. |
#define KOS_INIT_ROMDISK_NONE NULL |
State that you don't want a romdisk.
#define page_count ((16*1024*1024 - 0x10000) / PAGESIZE) |
Page count "variable".
The number of pages is static, so we can optimize this quite a bit.
#define page_phys_base 0x8c010000 |
Base address of available physical pages.
#define PAGEMASK (PAGESIZE - 1) |
Mask for page offset.
#define PAGESIZE 4096 |
Page size (for MMU)
#define PAGESIZE_BITS 12 |
Bits for page size.
#define THD_STACK_SIZE 32768 |
Default thread stack size.
void __crtend_pullin | ( | ) |
Hook to ensure linking of crtend.c.
void arch_abort | ( | ) |
Kernel "abort" point.
void arch_ctors | ( | ) |
Call to run all ctors.
void arch_dtors | ( | ) |
Call to run all dtors.
void arch_exit | ( | ) |
Generic kernel "exit" point.
int arch_main | ( | ) |
Kernel C-level entry point.
void arch_menu | ( | ) |
Kernel "exit to menu" call.
void arch_real_exit | ( | ) |
Jump back to the bootloader.
You generally shouldn't use this function, but rather use arch_exit() or exit() instead.
void arch_reboot | ( | ) |
Kernel "reboot" call.
void arch_return | ( | ) |
Kernel "return" point.
void arch_set_exit_path | ( | int | path | ) |
Set the exit path.
The default, if you don't call this, is ARCH_EXIT_RETURN.
path | What arch_exit() should do. |
int hardware_periph_init | ( | ) |
Initialize some peripheral systems.
This will be done automatically for you on start by the default arch_main(), so you shouldn't have to deal with this yourself.
0 | On success (no error conditions defined). |
void hardware_shutdown | ( | ) |
Shut down hardware that was initted.
This function will shut down anything initted with hardware_sys_init() and hardware_periph_init(). This will be done for you automatically by the various exit points, so you shouldn't have to do this yourself.
int hardware_sys_init | ( | ) |
Initialize bare-bones hardware systems.
This will be done automatically for you on start by the default arch_main(), so you shouldn't have to deal with this yourself.
0 | On success (no error conditions defined). |
int hardware_sys_mode | ( | int * | region | ) |
Retrieve the system mode of the console in use.
This function retrieves the system mode register of the console that is in use. This register details the actual system type in use (and in some system types the region of the device).
region | On return, the region code (one of the Region codes) of the device if the console type allows reading it through the system mode register – otherwise, you must retrieve the region from the flashrom. |
const char* kos_get_authors | ( | void | ) |
Retrieve a list of authors and the dates of their contributions.
This function retrieves the copyright information for the version of KOS in use. This function can be used to add such information to the credits of programs using KOS to give the appropriate credit to those that have worked on KOS.
Remember, you do need to give credit where credit is due, and this is an easy way to do so. ;-)
A | pointer to the authors' copyright information. |
const char* kos_get_banner | ( | void | ) |
Retrieve the banner printed at program initialization.
This function retrieves the banner string that is printed at initialization time by the kernel. This contains the version of KOS in use and basic information about the environment in which it was compiled.
A | pointer to the banner string. |
const char* kos_get_license | ( | void | ) |
Retrieve the license information for the compiled copy of KOS.
This function retrieves a string containing the license terms that the version of KOS in use is distributed under. This can be used to easily add information to your program to be displayed at runtime.
A | pointer to the license terms. |
int mm_init | ( | ) |
Initialize the memory management system.
0 | On success (no error conditions defined). |
void* mm_sbrk | ( | unsigned long | increment | ) |
Request more core memory from the system.
increment | The number of bytes requested. |
void panic | ( | const char * | str | ) |
Panic function.
This function will cause a kernel panic, printing the specified message.
str | The error message to print. |
uint32 __kos_init_flags |
The init flags. Do not modify this directly!
void* __kos_romdisk |
Built-in romdisk. Do not modify this directly!