int start_kernel(int argc, char *argv[]) { int i; int rc; int reg[16]; int cpsr; const int timer_irq = 49; cpsr = get_cpsr(); cpsr &= ~(1<<6 | 1<<7); /* enable irq & fiq */ cpsr = set_cpsr(cpsr); printk("starting kernel...\n"); printk("starting timer1...\n"); avic_init_irq((void *)0x80000000, 128); mxs_enable_fiq_functionality(1); icoll_unmask_irq(timer_irq); start_timer(0, 0, 0, 0); waitMsec(1000); printk("CPSR: [%08X]\n", getcpsr()); getr(reg); for(i=0; i<16; i++){ printk("register [%d]: [%X]\n", i, reg[i]); } printk("Hello World!\n"); while(1) { printk("E"); waitMsec(1000); } return 0; }
void main() { uint j=0,i=0,k=0; uint rev; ulong pc; pc = getpc(); pl011_addr((void *)pc, 1); pl011_puts("Entered main() at "); pl011_addr(&main, 0); pl011_puts(" with SP="); pl011_addr((void *)getsp(), 0); pl011_puts(" with SC="); pl011_addr((void *)getsc(), 0); pl011_puts(" with CPSR="); pl011_addr((void *)getcpsr(), 0); pl011_puts(" with SPSR="); pl011_addr((void *)getspsr(), 1); pl011_puts("Clearing Mach: "); memset(m, 0, sizeof(Mach)); pl011_addr((char *)m, 0); pl011_puts("-"); pl011_addr((char *)(m+1), 1); pl011_puts("Clearing edata: "); memset(edata, 0, end-edata); pl011_addr((char *)&edata, 0); pl011_puts("-"); pl011_addr((char *)&end, 1); conf.nmach = 1; quotefmtinstall(); confinit(); mmuinit1(); xinit(); poolinit(); poolsizeinit(); //uartconsinit(); screeninit(); trapinit(); timersinit(); clockinit(); printinit(); swcursorinit(); rev = getfirmware(); print("\nARM %ld MHz id %8.8lux firmware: rev %d, mem: %ld\n" ,(m->cpuhz+500000)/1000000, getcpuid(), rev, conf.topofmem/MB); print("Inferno OS %s Vita Nuova\n", VERSION); print("Ported to Raspberry Pi (BCM2835) by LynxLine\n\n"); procinit(); links(); chandevreset(); eve = strdup("inferno"); userinit(); schedinit(); pl011_puts("to inifinite loop\n\n"); for (;;); }