From b8fcaa5123ea4e2fbe92edbc557a0bd0644d0b18 Mon Sep 17 00:00:00 2001 From: Peter Weingartner Date: Mon, 24 Jun 2024 21:43:44 -0400 Subject: [PATCH] Channel and Block Device Code back --- src/include/features.h | 10 +++++ src/toolbox.c | 86 +++++++++++++++++++++--------------------- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/src/include/features.h b/src/include/features.h index ee35863..a2ddf09 100644 --- a/src/include/features.h +++ b/src/include/features.h @@ -12,6 +12,9 @@ // Actually, for the X this depends on the submodel. E.g. Pizza Box doesn't have floppy. #define HAS_FLOPPY 1 + // Does the model have a PATA / IDE interface + #define HAS_PATA 1 + // Actually, for the X this depends on the submodel. E.g. Pizza Box doesn't have floppy. #define HAS_PARALLEL_PORT 1 @@ -27,14 +30,17 @@ #define HAS_OPL3 1 #elif MODEL == MODEL_FOENIX_A2560U #define HAS_OPL3 1 + #define HAS_PATA 1 #elif MODEL == MODEL_FOENIX_C256U_PLUS || MODEL == MODEL_FOENIX_C256U #define HAS_OPL3 1 + #define HAS_PATA 1 #elif MODEL == MODEL_FOENIX_C256U_FMX #define HAS_SUPERIO 1 #define HAS_PARALLEL_PORT 1 #define HAS_MIDI_PORTS 1 #define HAS_EXTERNAL_SIDS 1 #define HAS_OPL3 1 + #define HAS_PATA 1 #elif MODEL == MODEL_FOENIX_F256KE #define HAS_EXTERNAL_SIDS 1 #define HAS_OPL3 1 @@ -51,6 +57,10 @@ #define HAS_FLOPPY 0 #endif +#ifndef HAS_PATA // PATA hard drive presence + #define HAS_PATA 0 +#endif + #ifndef HAS_PARALLEL_PORT // Parallel/Centronics port presence #define HAS_PARALLEL_PORT 0 #endif diff --git a/src/toolbox.c b/src/toolbox.c index 535c307..49e34a4 100644 --- a/src/toolbox.c +++ b/src/toolbox.c @@ -162,17 +162,17 @@ void initialize() { init_codec(); INFO("CODEC initialized."); -// cdev_init_system(); // Initialize the channel device system -// INFO("Channel device system ready."); + cdev_init_system(); // Initialize the channel device system + INFO("Channel device system ready."); -// bdev_init_system(); // Initialize the channel device system -// INFO("Block device system ready."); + bdev_init_system(); // Initialize the channel device system + INFO("Block device system ready."); -// if ((res = con_install())) { -// log_num(LOG_ERROR, "FAILED: Console installation", res); -// } else { -// INFO("Console installed."); -// } + // if ((res = con_install())) { + // log_num(LOG_ERROR, "FAILED: Console installation", res); + // } else { + // INFO("Console installed."); + // } // /* Initialize the timers the MCP uses */ // timers_init(); @@ -192,11 +192,13 @@ void initialize() { // // /* Play the SID test bong on the Gideon SID implementation */ // // sid_test_internal(); -// // if ((res = pata_install())) { -// // log_num(LOG_ERROR, "FAILED: PATA driver installation", res); -// // } else { -// // INFO("PATA driver installed."); -// // } +#if HAS_PATA + if ((res = pata_install())) { + log_num(LOG_ERROR, "FAILED: PATA driver installation", res); + } else { + INFO("PATA driver installed."); + } +#endif // if ((res = sdc_install())) { // ERROR1("FAILED: SDC driver installation %d", res); @@ -204,13 +206,13 @@ void initialize() { // INFO("SDC driver installed."); // } -// #if HAS_FLOPPY -// if ((res = fdc_install())) { -// ERROR1("FAILED: Floppy drive initialization %d", res); -// } else { -// INFO("Floppy drive initialized."); -// } -// #endif +#if HAS_FLOPPY + if ((res = fdc_install())) { + ERROR1("FAILED: Floppy drive initialization %d", res); + } else { + INFO("Floppy drive initialized."); + } +#endif // // At this point, we should be able to call into to console to print to the screens @@ -220,29 +222,29 @@ void initialize() { // log(LOG_INFO, "PS/2 keyboard initialized."); // } -// #if MODEL == MODEL_FOENIX_A2560K -// if ((res = kbdmo_init())) { -// log_num(LOG_ERROR, "FAILED: A2560K built-in keyboard initialization", res); -// } else { -// log(LOG_INFO, "A2560K built-in keyboard initialized."); -// } -// #endif +#if MODEL == MODEL_FOENIX_A2560K + if ((res = kbdmo_init())) { + log_num(LOG_ERROR, "FAILED: A2560K built-in keyboard initialization", res); + } else { + log(LOG_INFO, "A2560K built-in keyboard initialized."); + } +#endif -// #if HAS_PARALLEL_PORT -// if ((res = lpt_install())) { -// log_num(LOG_ERROR, "FAILED: LPT installation", res); -// } else { -// log(LOG_INFO, "LPT installed."); -// } -// #endif +#if HAS_PARALLEL_PORT + if ((res = lpt_install())) { + log_num(LOG_ERROR, "FAILED: LPT installation", res); + } else { + log(LOG_INFO, "LPT installed."); + } +#endif -// #if HAS_MIDI_PORTS -// if ((res = midi_install())) { -// log_num(LOG_ERROR, "FAILED: MIDI installation", res); -// } else { -// log(LOG_INFO, "MIDI installed."); -// } -// #endif +#if HAS_MIDI_PORTS + if ((res = midi_install())) { + log_num(LOG_ERROR, "FAILED: MIDI installation", res); + } else { + log(LOG_INFO, "MIDI installed."); + } +#endif // // if (res = uart_install()) { // // log_num(LOG_ERROR, "FAILED: serial port initialization", res);