| plan 9 kernel history: overview | file list | diff list |
1990/1202/power/bboot.c (diff list | history)
| 1990/1127/sys/src/9/power/bboot.c:7,18 – 1990/1202/sys/src/9/power/bboot.c:7,17 (short | long | prev | next) | ||
| 1990/1127 | #define DEFSYS "bit!bootes" | |
| 1990/0427 | Fcall hdr; | |
| 1990/1202 | char bootfile[5*NAMELEN]; char conffile[5*NAMELEN]; char sys[NAMELEN]; | |
| 1990/0427 |
| |
| 1990/0424 | char buf[4*1024]; | |
| 1990/0427 | int fd; | |
| 1990/1127/sys/src/9/power/bboot.c:66,72 – 1990/1202/sys/src/9/power/bboot.c:65,71 | ||
| 1990/0427 | int readseg(int, int, long, long, int); int readkernel(int); | |
| 1990/0504 | int readconf(int); | |
| 1990/0427 |
| |
| 1990/1202 | int outin(char *, char *, int); | |
| 1990/0427 | void prerror(char *); void error(char *); | |
| 1990/0504 | void boot(int, char *); | |
| 1990/1127/sys/src/9/power/bboot.c:97,111 – 1990/1202/sys/src/9/power/bboot.c:96,110 | ||
| 1990/0427 | break; } | |
| 1990/0424 | ||
| 1990/0427 |
| |
| 1990/1202 | strcpy(sys, DEFSYS); strcpy(bootfile, DEFFILE); | |
| 1990/0427 | switch(argc){ case 1: | |
| 1990/1202 | strcpy(bootfile, argv[0]); | |
| 1990/0427 | break; case 2: | |
| 1990/1202 | strcpy(bootfile, argv[0]); strcpy(sys, argv[1]); | |
| 1990/0427 | break; } | |
| 1990/0424 | ||
| 1990/1127/sys/src/9/power/bboot.c:255,268 – 1990/1202/sys/src/9/power/bboot.c:254,264 | ||
| 1990/1127 | boot(int ask, char *addr) { int n, tries; | |
| 1990/1202 | outin("bootfile", bootfile, sizeof(bootfile)); outin("server", sys, sizeof(sys)); | |
| 1990/1127 | } for(tries = 0; tries < 5; tries++){ | |
| 1990/1127/sys/src/9/power/bboot.c:271,278 – 1990/1202/sys/src/9/power/bboot.c:267,274 | ||
| 1990/1127 | fd = bitdial(srvname = &sys[4]); else if(strncmp(sys, "dk!", 3) == 0) fd = dkdial(srvname = &sys[3]); | |
| 1990/1202 | else if(strncmp(sys, "nonet!", 6) == 0) fd = nonetdial(srvname = &sys[6]); | |
| 1990/1127 | else fd = nonetdial(srvname = sys); if(fd >= 0) | |
| 1990/1127/sys/src/9/power/bboot.c:361,367 – 1990/1202/sys/src/9/power/bboot.c:357,363 | ||
| 1990/0504 | sprint(conffile, "/mips/conf/%s", addr); print("%s...", conffile); while((fd = open(conffile, OREAD)) < 0){ | |
| 1990/1202 | outin("conffile", conffile, sizeof(conffile)); | |
| 1990/0504 | } if(readconf(fd) < 0) prerror("readconf"); | |
| 1990/1127/sys/src/9/power/bboot.c:369,376 – 1990/1202/sys/src/9/power/bboot.c:365,371 | ||
| 1990/0504 | print("%s...", bootfile); | |
| 1990/0427 | while((fd = open(bootfile, OREAD)) < 0){ | |
| 1990/0504 |
| |
| 1990/0427 |
| |
| 1990/1202 | outin("bootfile", bootfile, sizeof(bootfile)); | |
| 1990/0427 | } | |
| 1990/0424 | readkernel(fd); | |
| 1990/0427 | prerror("couldn't read kernel"); | |
| 1990/1127/sys/src/9/power/bboot.c:551,557 – 1990/1202/sys/src/9/power/bboot.c:546,552 | ||
| 1990/0427 | * prompt and get input */ int | |
| 1990/1202 | outin(char *prompt, char *def, int len) | |
| 1990/0427 | { int n; | |
| 1990/1127/sys/src/9/power/bboot.c:561,569 – 1990/1202/sys/src/9/power/bboot.c:556,564 | ||
| 1990/0427 | }while(n==0); if(n < 0) error("can't read #c/cons; please reboot"); | |
| 1990/1202 | if(n != 1){ | |
| 1990/0427 | buf[n-1] = 0; | |
| 1990/1202 | strcpy(def, buf); } | |
| 1990/0427 | return n; | |
| 1990/0424 | } | |