wok diff linld/stuff/src/TAZBOOT.CPP @ rev 21791
Fix loram dos boot
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Aug 01 15:16:29 2019 +0200 (2019-08-01) |
parents | 2373992ff751 |
children | 1c40a6bea05c |
line diff
1.1 --- a/linld/stuff/src/TAZBOOT.CPP Mon Jun 24 16:31:09 2019 +0200 1.2 +++ b/linld/stuff/src/TAZBOOT.CPP Thu Aug 01 15:16:29 2019 +0200 1.3 @@ -163,8 +163,6 @@ 1.4 int main(int argc, char *argv[]) 1.5 { 1.6 ((u16*) &base_himem)[1] |= (_1m+_64k)>>16; // base_himem = _1m+_64k 1.7 - argv[0] = progname(); 1.8 - bootiso(argv); // iso ? parsing is /init.exe stuff ! 1.9 1.10 if (argc < 2) { 1.11 try_default_args(); 1.12 @@ -180,14 +178,38 @@ 1.13 kernel=\\slitaz\\elks\n\ 1.14 root=/dev/bda1 ro\n"); 1.15 } 1.16 - bootiso(argv + 1); 1.17 - chdirname(*argv); 1.18 + bootiso(argv + 1); // iso ? parsing is /init.exe stuff ! 1.19 for (int i=0;;) { 1.20 char *s; 1.21 next: argv++; 1.22 s=*argv; 1.23 i++; 1.24 - if (!s) break; 1.25 + if (!s) { 1.26 + if (isoreset(iso) != -1) { 1.27 + s = (char *) initrd_name; 1.28 + if (isoopen((char *) kernel_name) != -1) { 1.29 + isokernel(); 1.30 + } 1.31 + if (s) { 1.32 + do { 1.33 + char *p, c; 1.34 + for (p = s; *s && *s != ','; s++); 1.35 + c = *s; *s = 0; 1.36 + if (isoopen(p) != -1) { 1.37 + addinitrd(); 1.38 + } 1.39 + *s = c; 1.40 + if (c) s++; 1.41 + } while (*s); 1.42 + load_initrds(); 1.43 + } 1.44 + } 1.45 + else { 1.46 + load_kernel(); 1.47 + load_initrd(); 1.48 + } 1.49 + boot_kernel(); 1.50 + } 1.51 #ifdef USE_ARGSTR 1.52 if ((*(u16 *)s|0x2002) == 0x662F) { // -F /f 1.53 skip_alloc++; 1.54 @@ -201,32 +223,32 @@ 1.55 else strcatb(buf_cmdline,*argv); // FIXME mem ? 1.56 } 1.57 #else 1.58 - if (strhead(s,"kernel=") != -1) { 1.59 + if (strhead(s,"initrd=") != -1) { 1.60 + s += 7; 1.61 + initrd_name = s; 1.62 + } 1.63 + else if (strhead(s,"bootfrom=") != -1) { 1.64 + s += 9; 1.65 + goto set_iso; 1.66 + } 1.67 + else if (strhead(s,"iso=") != -1) { 1.68 + s += 4; 1.69 + set_iso: 1.70 + iso = s; 1.71 + } 1.72 + else if (strhead(s,"image=") != -1) { 1.73 + goto set_kernel; 1.74 + } 1.75 + else if(strhead(s,"vga=") != -1) { 1.76 + *(u16*)&vid_mode = (u16)strtol(s+4); // support normal, extended & ask 1.77 + } 1.78 + else if (strhead(s,"kernel=") != -1) { 1.79 s++; 1.80 set_kernel: 1.81 s += 6; 1.82 set_kernelz: 1.83 kernel_name = s; 1.84 } 1.85 - else if (strhead(s,"image=") != -1) { 1.86 - goto set_kernel; 1.87 - } 1.88 - else if (strhead(s,"initrd=") != -1) { 1.89 - s += 7; 1.90 - initrd_name = s; 1.91 - } 1.92 - else if (strhead(s,"bootfrom=") != -1) { 1.93 - s += 9; 1.94 - set_iso: 1.95 - iso = s; 1.96 - } 1.97 - else if (strhead(s,"iso=") != -1) { 1.98 - s += 4; 1.99 - goto set_iso; 1.100 - } 1.101 - else if(strhead(s,"vga=") != -1) { 1.102 - *(u16*)&vid_mode = (u16)strtol(s+4); // support normal, extended & ask 1.103 - } 1.104 else switch (*(u16 *)s|0x2002) { 1.105 case 0x662F: // -F /f 1.106 skip_alloc++; 1.107 @@ -255,29 +277,4 @@ 1.108 }} 1.109 } 1.110 #endif 1.111 - if (isoreset(iso) != -1) { 1.112 - char *s = (char *) initrd_name; 1.113 - if (isoopen((char *) kernel_name) != -1) { 1.114 - isokernel(); 1.115 - } 1.116 - if (s) { 1.117 - while (*s) { 1.118 - char *p, c; 1.119 - for (p = s; *s && *s != ','; s++); 1.120 - c = *s; *s = 0; 1.121 - if (isoopen(p) != -1) { 1.122 - addinitrd(); 1.123 - } 1.124 - *s = c; 1.125 - if (c) s++; 1.126 - } 1.127 - load_initrds(); 1.128 - } 1.129 - } 1.130 - else { 1.131 - load_kernel(); 1.132 - load_initrd(); 1.133 - } 1.134 - boot_kernel(); 1.135 - return _AX; 1.136 }