Hallo Welt mit KallistiOS: Unterschied zwischen den Versionen
Aus SEGA-DC.DE
(Die Seite wurde neu angelegt: Das folgende kleine Programm zeigt einen Hallo Welt-Schriftzug auf dem Bildschirm an. #include <kos.h> extern uint8 romdisk[]; /* These macros tell KOS how to ...) |
Keine Bearbeitungszusammenfassung |
||
Zeile 5: | Zeile 5: | ||
extern uint8 romdisk[]; | extern uint8 romdisk[]; | ||
KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); | |||
KOS_INIT_ROMDISK(romdisk); | |||
/* Your program's main entry point */ | |||
int main(int argc, char **argv) { | |||
/* The requisite line */ | |||
printf("\nHello world!\n\n"); | |||
return 0; | |||
} | |||
/* These macros tell KOS how to initialize itself. All of this initialization | /* These macros tell KOS how to initialize itself. All of this initialization | ||
happens before main() gets called, and the shutdown happens afterwards. So | happens before main() gets called, and the shutdown happens afterwards. So | ||
Zeile 17: | Zeile 31: | ||
You can OR any or all of those together. If you want to start out with | You can OR any or all of those together. If you want to start out with | ||
the current KOS defaults, use INIT_DEFAULT (or leave it out entirely). */ | the current KOS defaults, use INIT_DEFAULT (or leave it out entirely). */ | ||
Version vom 6. Mai 2009, 09:01 Uhr
Das folgende kleine Programm zeigt einen Hallo Welt-Schriftzug auf dem Bildschirm an.
#include <kos.h> extern uint8 romdisk[];
KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); KOS_INIT_ROMDISK(romdisk); /* Your program's main entry point */ int main(int argc, char **argv) { /* The requisite line */ printf("\nHello world!\n\n"); return 0; }
/* These macros tell KOS how to initialize itself. All of this initialization happens before main() gets called, and the shutdown happens afterwards. So you need to set any flags you want here. Here are some possibilities: INIT_NONE -- don't do any auto init INIT_IRQ -- Enable IRQs INIT_THD_PREEMPT -- Enable pre-emptive threading INIT_NET -- Enable networking (doesn't imply lwIP!) INIT_MALLOCSTATS -- Enable a call to malloc_stats() right before shutdown You can OR any or all of those together. If you want to start out with the current KOS defaults, use INIT_DEFAULT (or leave it out entirely). */