Esempio n. 1
0
void
_start(void)
{
	// read in the video buffer address
	// it assumes that the MMU mappings haven't changed
	// and the buffer is in the 4kb SRAM
	volatile unsigned *LCDSADDR1 = (unsigned *)0x7300014;
	__display_buf = (*LCDSADDR1 & 0xffff) * 2 + 0x7f00000;

	// set the screen height for the <hpstdio.h> module
	extern int __scr_h;
	__scr_h = (sys_lcdgetheight() == 64)? 10: 13;

	// declare locally to reduce executable size
	unsigned state_buffer[4];
	__exit_stk_state = state_buffer;

	// turn interrupts off so we can use the screen
	sys_intOff();

	// will return 0 when exitting
	if (_exit_save((unsigned *)state_buffer)) {
		show_system_info();
		__exit_cleanup();
	}

	// turn interrupts on for the OS
	sys_intOn();
}
Esempio n. 2
0
void
_start(void)
{
	// read in the video buffer address
	// it assumes that the MMU mappings haven't changed
	// and the buffer is in the 4kb SRAM
	volatile unsigned *LCDSADDR1 = (unsigned *)0x7300014;
	__display_buf = (*LCDSADDR1 & 0xffff) * 2 + 0x7f00000;

	// set the screen height for the <hpstdio.h> module
	extern int __scr_h;
	__scr_h = 11;

	// declare locally to reduce executable size
	int state_buffer[4], lcd_buffer[17];
	__exit_stk_state = state_buffer;

	// turn interrupts off so we can use the screen
	sys_intOff();

	// save current hardware state
	sys_lcdsave(lcd_buffer);

	// slow down the clock to save power
	sys_slowOn();

	// will return 0 when exitting
	if (_exit_save((unsigned *)state_buffer)) {
		main();
		__exit_cleanup();
	}

	// restore original hardware values
	sys_slowOff();
	sys_lcdrestore(lcd_buffer);

	// turn interrupts on for the OS
	sys_intOn();
}