📄 wini.c
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/kernel/wini.c
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10000 /* wini.c - choose a winchester driver. Author: Kees J. Bot
10001 * 28 May 1994
10002 * Several different winchester drivers may be compiled
10003 * into the kernel, but only one may run. That one is chosen here using
10004 * the boot variable 'hd'.
10005 */
10006
10007 #include "kernel.h"
10008 #include "driver.h"
10009
10010 #if ENABLE_WINI
10011
10012 /* Map driver name to task function. */
10013 struct hdmap {
10014 char *name;
10015 task_t *task;
10016 } hdmap[] = {
10017
10018 #if ENABLE_AT_WINI
10019 { "at", at_winchester_task },
10020 #endif
10021
10022 #if ENABLE_BIOS_WINI
10023 { "bios", bios_winchester_task },
10024 #endif
10025
10026 #if ENABLE_ESDI_WINI
10027 { "esdi", esdi_winchester_task },
10028 #endif
10029
10030 #if ENABLE_XT_WINI
10031 { "xt", xt_winchester_task },
10032 #endif
10033
10034 };
10035
10036
10037 /*===========================================================================*
10038 * winchester_task *
10039 *===========================================================================*/
10040 PUBLIC void winchester_task()
10041 {
10042 /* Call the default or selected winchester task. */
10043 char *hd;
10044 struct hdmap *map;
10045
10046 hd = k_getenv("hd");
10047
10048 for (map = hdmap; map < hdmap + sizeof(hdmap)/sizeof(hdmap[0]); map++) {
10049 if (hd == NULL || strcmp(hd, map->name) == 0) {
10050 /* Run the selected winchester task. */
10051 (*map->task)();
10052 }
10053 }
10054 panic("no hd driver", NO_NUM);
10055 }
10056 #endif /* ENABLE_WINI */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -