/[packages]/cauldron/pxe/current/SOURCES/pxe-1.0-cmdlinearg.patch
ViewVC logotype

Contents of /cauldron/pxe/current/SOURCES/pxe-1.0-cmdlinearg.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49059 - (show annotations) (download)
Tue Feb 8 16:41:51 2011 UTC (13 years, 2 months ago) by ennael
File size: 3099 byte(s)
imported package pxe
1 --- pxe-linux/nbp.linux/linux.c Thu Sep 23 17:58:21 1999
2 +++ pxe-linux/nbp.linux/linux.c Tue Dec 21 14:36:04 1999
3 @@ -42,6 +42,41 @@
4 ;
5 }
6
7 +int
8 +do_timeout(int seconds)
9 +{
10 + long lasttick;
11 + int ticks;
12 + int key;
13 +
14 + for (;;) {
15 + bputc('(');
16 + if (seconds > 99)
17 + bputh1(seconds / 100);
18 + if (seconds > 9)
19 + bputh1((seconds / 10) % 10);
20 + bputh1(seconds % 10);
21 + bputc(')');
22 + bputc(' ');
23 +
24 + for (ticks = 18; ticks--; ) {
25 + for (lasttick = tickcount(); lasttick == tickcount(); ) {
26 + if (kbhit()) {
27 + key = bgetc();
28 + return 1;
29 + }
30 + }
31 + }
32 +
33 + bputs(&"\b\b\b\b\b\b"[(seconds < 10) + (seconds < 100)]);
34 +
35 + if (!seconds--) {
36 + cll();
37 + return 0;
38 + }
39 + }
40 +}
41 +
42 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
43 /* unsigned nbpentry(pxeptr, pxenvptr)
44 * C entry point for PXE bootstrap programs.
45 @@ -62,6 +97,12 @@
46 t_IP sip;
47 int type;
48 int layer;
49 + char cmdline[255];
50 + char * chptr = cmdline;
51 + int key;
52 + int where;
53 +
54 + cmdline[0] = '\0';
55
56 bputs("\nIntel Linux NBP, Beta-3 (build 003)\n\n");
57
58 @@ -98,6 +139,38 @@
59 return PXENV_STATUS_FAILURE;
60 }
61
62 + bputs("Press any key to enter kernel parameters... ");
63 + if (do_timeout(5) == 1) {
64 + bputc('\n');
65 + bputs("Enter kernel parameters: ");
66 + where = getcol();
67 + for (key = bgetc(); key != 0x1C0D; key = bgetc()) {
68 + switch (key) {
69 + case 0x0E08: /* Backspace */
70 + if (chptr == cmdline) break;
71 + chptr--;
72 + gotorc(getrow(),
73 + chptr - cmdline + where);
74 + bputc(' ');
75 + gotorc(getrow(),
76 + chptr - cmdline + where);
77 + break;
78 +
79 + default:
80 + *chptr++ = key & 0xFF;
81 + bputc(key & 0xFF);
82 + break;
83 + }
84 + }
85 + *chptr = '\0';
86 + bputc('\n');
87 + }
88 + else
89 + {
90 + strncpy(cmdline,"ks console=ttyS0,115200",23);
91 + }
92 + bputc('\n');
93 +
94 /*
95 * Initialize default gateway for UDP and TFTP API calls.
96 */
97 @@ -264,7 +337,7 @@
98 * Initialize boot sector and setup parameters
99 */
100
101 - if (!prepare_bootsect_setup())
102 + if (!prepare_bootsect_setup(cmdline))
103 return PXENV_STATUS_FAILURE;
104
105 /*
106 diff -ur pxe-linux.orig/nbp.linux/menu.c pxe-linux/nbp.linux/menu.c
107 diff -ur pxe-linux.orig/nbp.linux/nbp.h pxe-linux/nbp.linux/nbp.h
108 --- pxe-linux/nbp.linux/nbp.h Thu Sep 23 20:58:21 1999
109 +++ pxe-linux/nbp.linux/nbp.h Sun Sep 26 04:00:23 1999
110 @@ -70,7 +70,7 @@
111
112 int do_restart();
113
114 -int prepare_bootsect_setup();
115 +int prepare_bootsect_setup(char * cmdline);
116
117 int unload_pxe();
118
119 diff -ur pxe-linux.orig/nbp.linux/prepare.c pxe-linux/nbp.linux/prepare.c
120 --- pxe-linux/nbp.linux/prepare.c Thu Sep 23 20:58:21 1999
121 +++ pxe-linux/nbp.linux/prepare.c Sun Sep 26 04:02:47 1999
122 @@ -63,7 +63,7 @@
123
124 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
125 int
126 -prepare_bootsect_setup()
127 +prepare_bootsect_setup(char * cmdline)
128 {
129 BOOTSECT bootsect;
130 SETUP setup;
131 @@ -208,6 +208,10 @@
132 /*
133 * Initialize boot device for initrd, if necessary.
134 */
135 +
136 + bootsect.cmdline_magic = 0xA33F;
137 + bootsect.cmdline_offset = 36;
138 + strcpy(bootsect.reserved2, cmdline);
139
140 if (initrd_addr && initrd_size) {
141 /*

  ViewVC Help
Powered by ViewVC 1.1.30