Single boot driver loaded, while multiple can be included in the boot image.
The user needs to set label=... to choose the driver of his or her choice. This driver will be mapped onto the controller that is set in controller=... Minor cleanup of kernel source code (boot image table now is static).
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
*/
|
||||
#define vir2phys(vir) (kinfo.data_base + (vir_bytes) (vir))
|
||||
|
||||
/* Map a process number to a privilege structure id. Used at boot time. */
|
||||
#define s_nr_to_id(n) (NR_TASKS + (n) + 1)
|
||||
#define s(n) (1 << s_nr_to_id(n))
|
||||
|
||||
/* Translate a pointer to a field in a structure to a pointer to the structure
|
||||
* itself. So it translates '&struct_ptr->field' back to 'struct_ptr'.
|
||||
*/
|
||||
|
||||
23
kernel/ipc.h
23
kernel/ipc.h
@@ -24,27 +24,4 @@
|
||||
#define CHECK_SRC 0x02 /* 0 0 1 0 : validate message source */
|
||||
|
||||
|
||||
/* Send masks determine to whom processes can send messages or notifications.
|
||||
* The values here are used for the processes in the boot image. We rely on
|
||||
* the initialization code in main() to match the s_nr_to_id() mapping for the
|
||||
* processes in the boot image, so that the send mask that is defined here
|
||||
* can be directly copied onto map[0] of the actual send mask. Privilege
|
||||
* structure 0 is shared by user processes.
|
||||
*
|
||||
* Note that process numbers in the boot image should not be higher than
|
||||
* "BITCHUNK_BITS - NR_TASKS", because a bitchunk_t field is used to store
|
||||
* the send masks in the table that describes that processes in the image.
|
||||
*/
|
||||
#define s_nr_to_id(n) (NR_TASKS + (n) + 1)
|
||||
#define s(n) (1 << s_nr_to_id(n))
|
||||
#define SERV_M (~0)
|
||||
#define SYST_M (~0)
|
||||
#define USER_M (s(PM_PROC_NR)|s(FS_PROC_NR)|s(SM_PROC_NR))
|
||||
#define DRIV_M (USER_M | \
|
||||
s(SYSTEM)|s(CLOCK)|s(LOG_PROC_NR)|s(TTY_PROC_NR))
|
||||
|
||||
/* Sanity check to make sure the send masks can be set. */
|
||||
extern int dummy[(BITCHUNK_BITS-NR_TASKS > INIT_PROC_NR) ? 1 : -1];
|
||||
|
||||
|
||||
#endif /* IPC_H */
|
||||
|
||||
@@ -173,7 +173,7 @@ PRIVATE void announce(void)
|
||||
|
||||
#if (CHIP == INTEL)
|
||||
/* Real mode, or 16/32-bit protected mode? */
|
||||
kprintf("Executing in %s mode\n\n",
|
||||
kprintf("Executing in %s mode.\n\n",
|
||||
machine.protected ? "32-bit protected" : "real");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */
|
||||
kinfo.kmem_base = vir2phys(0);
|
||||
kinfo.kmem_size = (phys_bytes) &end;
|
||||
|
||||
/* Processor? 86, 186, 286, 386, ... */
|
||||
/* Processor? 86, 186, 286, 386, ...
|
||||
* Decide if mode is protected for older machines.
|
||||
*/
|
||||
machine.processor=atoi(get_value(params, "processor"));
|
||||
|
||||
/* Decide if mode is protected for older machines. */
|
||||
#if _WORD_SIZE == 2
|
||||
machine.protected = machine.processor >= 286;
|
||||
#endif
|
||||
@@ -83,7 +83,7 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */
|
||||
}
|
||||
|
||||
/* Type of VDU: */
|
||||
value = get_value(params, "video"); /* EGA or VGA video unit */
|
||||
value = get_value(params, "video"); /* EGA or VGA video unit */
|
||||
if (strcmp(value, "ega") == 0) machine.vdu_ega = TRUE;
|
||||
if (strcmp(value, "vga") == 0) machine.vdu_vga = machine.vdu_ega = TRUE;
|
||||
|
||||
|
||||
@@ -58,6 +58,26 @@ PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)];
|
||||
#define SERV_T (~0) /* system services */
|
||||
#define USER_T ((1 << SENDREC) | (1 << ECHO)) /* user processes */
|
||||
|
||||
/* Send masks determine to whom processes can send messages or notifications.
|
||||
* The values here are used for the processes in the boot image. We rely on
|
||||
* the initialization code in main() to match the s_nr_to_id() mapping for the
|
||||
* processes in the boot image, so that the send mask that is defined here
|
||||
* can be directly copied onto map[0] of the actual send mask. Privilege
|
||||
* structure 0 is shared by user processes.
|
||||
*
|
||||
* Note that process numbers in the boot image should not be higher than
|
||||
* "BITCHUNK_BITS - NR_TASKS", because a bitchunk_t field is used to store
|
||||
* the send masks in the table that describes that processes in the image.
|
||||
*/
|
||||
#define SERV_M (~0)
|
||||
#define SYST_M (~0)
|
||||
#define USER_M (s(PM_PROC_NR)|s(FS_PROC_NR)|s(SM_PROC_NR))
|
||||
#define DRIV_M (USER_M | \
|
||||
s(SYSTEM)|s(CLOCK)|s(LOG_PROC_NR)|s(TTY_PROC_NR))
|
||||
|
||||
/* Sanity check to make sure the send masks can be set. */
|
||||
extern int dummy[(BITCHUNK_BITS-NR_TASKS > INIT_PROC_NR) ? 1 : -1];
|
||||
|
||||
|
||||
/* The system image table lists all programs that are part of the boot image.
|
||||
* The order of the entries here MUST agree with the order of the programs
|
||||
@@ -78,8 +98,7 @@ PUBLIC struct boot_image image[] = {
|
||||
{ TTY_PROC_NR, 0, SERV_F, 16, 1, 0, SERV_T, SYST_M, "tty" },
|
||||
{ MEM_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "memory" },
|
||||
{ LOG_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, SYST_M, "log" },
|
||||
{ AT_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "boot" },
|
||||
{ BIOS_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, SYST_M, "bios" },
|
||||
{ DRVR_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "driver" },
|
||||
{ INIT_PROC_NR, 0, USER_F, 8, USER_Q, 0, USER_T, USER_M, "init" },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user