| plan 9 kernel history: overview | file list | diff list |
1991/1113/pc/main.c (diff list | history)
| 1991/1113/sys/src/9/pc/main.c:8,17 – 1991/1210/sys/src/9/pc/main.c:8,19 (short | long | prev | next) | ||
| 1991/0716 | #include "init.h" | |
| 1991/0629 | ||
| 1991/0716 | extern long edata; | |
| 1991/1210 | int machtype; | |
| 1991/0711 | ||
| 1991/0716 | void | |
| 1991/0702 | main(void) | |
| 1991/0625 | { | |
| 1991/1210 | ident(); | |
| 1991/0827 | meminit(); | |
| 1991/0711 | machinit(); | |
| 1991/1113 | active.exiting = 0; | |
| 1991/1113/sys/src/9/pc/main.c:42,47 – 1991/1210/sys/src/9/pc/main.c:44,61 | ||
| 1991/0712 | } | |
| 1991/0706 | ||
| 1991/0716 | void | |
| 1991/1210 | ident(void) { char *id = (char*)(ROMBIOS + 0xFF40); /* check for a safari (tres special) */ if(strncmp(id, "AT&TNSX", 7) == 0) machtype = Attnsx; else machtype = At; } void | |
| 1991/0716 | machinit(void) | |
| 1991/0712 | { | |
| 1991/0716 | int n; | |
| 1991/1113/sys/src/9/pc/main.c:342,383 – 1991/1210/sys/src/9/pc/main.c:356,381 | ||
| 1991/0712 | } | |
| 1991/0906 | /* | |
| 1991/0803 |
| |
| 1991/1210 | * the following functions all are slightly different from * PC to PC. | |
| 1991/0803 | */ | |
| 1991/0806 |
| |
| 1991/0803 |
| |
| 1991/1210 | /* enable address bit 20 (extended memory) */ | |
| 1991/0803 | void | |
| 1991/0827 | meminit(void) | |
| 1991/0803 | { | |
| 1991/0827 |
| |
| 1991/1210 | switch(machtype){ case Attnsx: heada20(); /* via headland chip */ break; case At: i8042a20(); /* via keyboard controller */ break; } | |
| 1991/0803 | } /* | |
| 1991/1210 | * reset the i387 chip | |
| 1991/0803 | */ void exit(void) | |
| 1991/1113/sys/src/9/pc/main.c:386,513 – 1991/1210/sys/src/9/pc/main.c:384,474 | ||
| 1991/0803 | u = 0; print("exiting\n"); | |
| 1991/1210 | switch(machtype){ case Attnsx: headreset(); /* via headland chip */ break; case At: i8042reset(); /* via keyboard controller */ break; } | |
| 1991/0803 | } /* | |
| 1991/1210 | * set cpu speed * 0 == low speed * 1 == high speed | |
| 1991/0803 | */ | |
| 1991/1210 | int cpuspeed(int speed) | |
| 1991/0803 | { | |
| 1991/1210 | switch(machtype){ case Attnsx: return pmucpuspeed(speed); default: return 0; } | |
| 1991/0803 | } /* | |
| 1991/1210 | * f == frequency (Hz) * d == duration (ms) | |
| 1991/0803 | */ | |
| 1991/1210 | void buzz(int f, int d) | |
| 1991/0803 | { | |
| 1991/1210 | switch(machtype){ case Attnsx: pmubuzz(f, d); break; default: break; } | |
| 1991/0803 | } /* | |
| 1991/1210 | * each bit in val stands for a light | |
| 1991/0803 | */ | |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/1210 | void lights(int val) | |
| 1991/0803 | { | |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/1210 | switch(machtype){ case Attnsx: pmulights(val); break; default: break; | |
| 1991/0809 | } | |
| 1991/0803 |
| |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/0809 |
| |
| 1991/0803 |
| |
| 1991/0809 |
| |
| 1991/0810 |
| |
| 1991/0803 | } /* | |
| 1991/0913 | * power to serial port | |
| 1991/0803 |
| |
| 1991/1210 | * onoff == 1 means on * onoff == 0 means off | |
| 1991/0803 | */ int serial(int onoff) { | |
| 1991/1210 | switch(machtype){ case Attnsx: return pmuserial(onoff); default: return 0; } | |
| 1991/0803 | } | |
| 1991/1001 | /* * power to modem | |
| 1991/1210 | * onoff == 1 means on * onoff == 0 means off | |
| 1991/1001 | */ int modem(int onoff) { | |
| 1991/1029 |
| |
| 1991/0913 |
| |
| 1991/0803 |
| |
| 1991/0913 |
| |
| 1991/0803 |
| |
| 1991/0913 |
| |
| 1991/0803 |
| |
| 1991/0913 |
| |
| 1991/1113 |
| |
| 1991/1210 | switch(machtype){ case Attnsx: return pmumodem(onoff); default: return 0; } | |
| 1991/0803 | } | |