Skip to content

Commit 7d263cc

Browse files
FozzTexxtschak909
authored andcommitted
Print CONFIG.SYS line since DOS 2.10 doesn't seem to be passing options
1 parent 0c1f815 commit 7d263cc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

sys/init.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ uint8_t get_set_time(uint8_t set_flag)
129129
uint16_t year_wcen;
130130

131131

132+
consolef("Getting FujiNet time\n");
132133
cmd.device = DEVICEID_APETIME;
133134
cmd.comnd = CMD_APETIME_GETTZTIME;
134135

@@ -199,6 +200,7 @@ void check_uart()
199200
}
200201

201202
/* Parse CONFIG.SYS command line, returns number of bytes remaining in config_env */
203+
#define IS_CONFIG_EOL(c) (!c || c == '\r' || c == '\n')
202204
uint16_t parse_config(const uint8_t far *config_sys)
203205
{
204206
int idx, count;
@@ -208,12 +210,16 @@ uint16_t parse_config(const uint8_t far *config_sys)
208210
uint8_t eq_flag;
209211

210212

213+
consolef("CONFIG.SYS: ");
214+
for (cfg = config_sys; cfg && !IS_CONFIG_EOL(*cfg); cfg++)
215+
printChar(*cfg);
216+
consolef("\n");
211217
*cfg_env = NULL;
212218
buf = (char *) &cfg_env[1];
213219
buf_max = (char *) cfg_env + ((uint16_t) &driver_end - (uint16_t) &config_env);
214220

215221
// Driver filename is everything before the first space
216-
for (cfg = config_sys; cfg && *cfg && *cfg != ' ' && *cfg != '\r' && *cfg != '\n'; cfg++)
222+
for (cfg = config_sys; cfg && *cfg != ' ' && !IS_CONFIG_EOL(*cfg); cfg++)
217223
;
218224

219225
if (*cfg != ' ')
@@ -231,7 +237,7 @@ uint16_t parse_config(const uint8_t far *config_sys)
231237
count = 0;
232238
while (1) {
233239
// Find end of this config option
234-
for (; cfg && *cfg && *cfg != ' ' && *cfg != '\r' && *cfg != '\n'; cfg++)
240+
for (; cfg && *cfg != ' ' && !IS_CONFIG_EOL(*cfg); cfg++)
235241
;
236242
count++;
237243
if (*cfg != ' ')
@@ -250,7 +256,7 @@ uint16_t parse_config(const uint8_t far *config_sys)
250256
cfg_env[idx] = buf;
251257

252258
// Find end of this config option
253-
for (eq_flag = 0; cfg && *cfg && *cfg != ' ' && *cfg != '\r' && *cfg != '\n'; cfg++) {
259+
for (eq_flag = 0; cfg && *cfg != ' ' && !IS_CONFIG_EOL(*cfg); cfg++) {
254260
if (*cfg == '=')
255261
eq_flag = 1;
256262
*buf = *cfg;

0 commit comments

Comments
 (0)