*** empty log message ***

This commit is contained in:
Jorrit Herder
2005-04-29 15:36:43 +00:00
parent 0e869cdd44
commit 89ac678b9b
78 changed files with 1293 additions and 2858 deletions

View File

@@ -1,55 +1,129 @@
/* BIOS definitions. Each BIOS entry has an index that is to be used with the
* sys_bioscopy() system call. The raw addresses, sizes, and magic numbers
* are defined here as well. The values that are defined here were collected
* from various kernel files in MINIX 2.0.4.
*
* Author: Jorrit N. Herder
/* Definitions of several known BIOS addresses. The addresses listed here
* are found in three memory areas that have been defined in <ibm/memory.h>.
* - the BIOS interrupt vectors
* - the BIOS data area
* - the motherboard BIOS memory
*
* Created: March 2005, Jorrit N. Herder
*/
#ifndef _BIOS_H
#define _BIOS_H
/* Memory check (is stopped on reboot). */
#define BIOS_MEM_CHECK 0 /* address to stop memory check */
#define ADR_MEM_CHECK 0x472L
#define LEN_MEM_CHECK 1L
#define STOP_MEM_CHECK 0x1234 /* magic number to stop memory check */
/* Centronics printers. */
#define BIOS_PRN_PORTBASE 1 /* base of printer ports */
#define ADR_PRN_PORTBASE 0x408L
#define LEN_PRN_PORTBASE 2L
/* PART I --
* The BIOS interrupt vector table (IVT) area (1024 B as of address 0x0000).
* Although this area holds 256 interrupt vectors (with jump addresses), some
* vectors actually contain important BIOS data. Some addresses are below.
*/
#define BIOS_EQUIP_CHECK_ADDR 0x0044
#define BIOS_EQUIP_CHECK_SIZE 4L
/* Hard disk parameter vectors. */
#define BIOS_WINI_PARAMS 2 /* number of hard disk drives */
#define ADR_WINI_PARAMS 0x475L
#define LEN_WINI_PARAMS 1L
#define BIOS_WINI_0_PARM_VEC 3 /* disk 0 parameters */
#define ADR_WINI_0_PARM_VEC 0x41*4L
#define LEN_WINI_0_PARM_VEC 4L
#define BIOS_WINI_1_PARM_VEC 4 /* disk 1 parameters */
#define ADR_WINI_1_PARM_VEC 0x46*4L
#define LEN_WINI_1_PARM_VEC 4L
#define BIOS_VIDEO_PARAMS_ADDR 0x0074
#define BIOS_VIDEO_PARAMS_SIZE 4L
#define BIOS_FLOP_PARAMS_ADDR 0x0078
#define BIOS_FLOP_PARAMS_SIZE 4L
#define BIOS_HD0_PARAMS_ADDR 0x0104 /* disk 0 parameters */
#define BIOS_HD0_PARAMS_SIZE 4L
#define BIOS_HD1_PARAMS_ADDR 0x0118 /* disk 1 parameters */
#define BIOS_HD1_PARAMS_SIZE 4L
/* PART I --
* Addresses in the BIOS data area (256 B as of address 0x0400). The addresses
* listed below are the most important ones, and the ones that are currently
* used. Other addresses may be defined below when new features are added.
*/
/* Parallel ports (LPT1-LPT4). */
#define COM1_IO_PORT_ADDR 0x400 /* COM1 port address */
#define COM1_IO_PORT_SIZE 2L
#define COM2_IO_PORT_ADDR 0x402 /* COM2 port address */
#define COM2_IO_PORT_SIZE 2L
#define COM3_IO_PORT_ADDR 0x404 /* COM3 port address */
#define COM3_IO_PORT_SIZE 2L
#define COM4_IO_PORT_ADDR 0x406 /* COM4 port address */
#define COM4_IO_PORT_SIZE 2L
/* Serial ports (COM1-COM4). */
#define LPT1_IO_PORT_ADDR 0x408 /* LPT1 port address */
#define LPT1_IO_PORT_SIZE 2L
#define LPT2_IO_PORT_ADDR 0x40A /* LPT2 port address */
#define LPT2_IO_PORT_SIZE 2L
#define LPT3_IO_PORT_ADDR 0x40C /* LPT3 port address */
#define LPT3_IO_PORT_SIZE 2L
#define LPT4_IO_PORT_ADDR 0x40E /* LPT4 port (except on PS/2) */
#define LPT4_IO_PORT_SIZE 2L
/* Video controller (VDU). */
#define VDU_SCREEN_COLS_ADDR 0x44A /* VDU nr of screen columns */
#define VDU_SCREEN_COLS_SIZE 2L
/* Base I/O port address for active 6845 CRT controller. */
#define VDU_CRT_BASE_ADDR 0x463 /* 3B4h = mono, 3D4h = color */
#define VDU_CRT_BASE_SIZE 2L
/* Soft reset flags to control shutdown. */
#define SOFT_RESET_FLAG_ADDR 0x472 /* soft reset flag on Ctl-Alt-Del */
#define SOFT_RESET_FLAG_SIZE 2L
#define STOP_MEM_CHECK 0x1234 /* bypass memory tests & CRT init */
#define PRESERVE_MEMORY 0x4321 /* preserve memory */
#define SYSTEM_SUSPEND 0x5678 /* system suspend */
#define MANUFACTURER_TEST 0x9ABC /* manufacturer test */
#define CONVERTIBLE_POST 0xABCD /* convertible POST loop */
/* ... many other values are used during POST */
/* Hard disk parameters. (Also see BIOS interrupt vector table above.) */
#define NR_HD_DRIVES_ADDR 0x475 /* number of hard disk drives */
#define NR_HD_DRIVES_SIZE 1L
/* Parallel ports (LPT1-LPT4) timeout values. */
#define LPT1_TIMEOUT_ADDR 0x478 /* time-out value for LPT1 */
#define LPT1_TIMEOUT_SIZE 1L
#define LPT2_TIMEOUT_ADDR 0x479 /* time-out value for LPT2 */
#define LPT2_TIMEOUT_SIZE 1L
#define LPT3_TIMEOUT_ADDR 0x47A /* time-out value for LPT3 */
#define LPT3_TIMEOUT_SIZE 1L
#define LPT4_TIMEOUT_ADDR 0x47B /* time-out for LPT4 (except PS/2) */
#define LPT4_TIMEOUT_SIZE 1L
/* Serial ports (COM1-COM4) timeout values. */
#define COM1_TIMEOUT_ADDR 0x47C /* time-out value for COM1 */
#define COM1_TIMEOUT_SIZE 1L
#define COM2_TIMEOUT_ADDR 0x47D /* time-out value for COM2 */
#define COM2_TIMEOUT_SIZE 1L
#define COM3_TIMEOUT_ADDR 0x47E /* time-out value for COM3 */
#define COM3_TIMEOUT_SIZE 1L
#define COM4_TIMEOUT_ADDR 0x47F /* time-out value for COM4 */
#define COM4_TIMEOUT_SIZE 1L
/* Video controller (VDU). */
#define BIOS_VDU_COLUMNS 5
#define ADR_VDU_COLUMNS 0x44AL
#define LEN_VDU_COLUMNS 2L
#define BIOS_VDU_CRTBASE 6
#define ADR_VDU_CRTBASE 0x463L
#define LEN_VDU_CRTBASE 2L
#define BIOS_VDU_ROWS 7
#define ADR_VDU_ROWS 0x484L
#define LEN_VDU_ROWS 1L
#define BIOS_VDU_FONTLINES 8
#define ADR_VDU_FONTLINES 0x485L
#define LEN_VDU_FONTLINES 2L
#define VDU_SCREEN_ROWS_ADDR 0x484 /* screen rows (less 1, EGA+)*/
#define VDU_SCREEN_ROWS_SIZE 1L
#define VDU_FONTLINES_ADDR 0x485 /* point height of char matrix */
#define VDU_FONTLINES_SIZE 2L
/* Video controller (VDU). */
#define VDU_VIDEO_MODE_ADDR 0x49A /* current video mode */
#define VDU_VIDEO_MODE_SIZE 1L
/* PART III --
* The motherboard BIOS memory contains some known values that are currently
* in use. Other sections in the upper memory area (UMA) addresses vary in
* size and locus and are not further defined here. A rough map is given in
* <ibm/memory.h>.
*/
/* Machine ID (we're interested in PS/2 and AT models). */
#define MACHINE_ID_ADDR 0xFFFFE /* BIOS machine ID byte */
#define MACHINE_ID_SIZE 1L
#define PS_386_MACHINE 0xF8 /* ID byte for PS/2 modela 70/80 */
#define PC_AT_MACHINE 0xFC /* PC/AT, PC/XT286, PS/2 models 50/60 */
/* Machine ID. */
#define BIOS_MACHINE_ID 9
#define ADR_MACHINE_ID 0xFFFFEL
#define LEN_MACHINE_ID 1L
#define PS_386_MACHINE 0xF8 /* Machine ID byte for PS/2 model 80 */
#define PC_AT_MACHINE 0xFC /* PC/AT, PC/XT286, PS/2 models 50/60 */
#endif /* _BIOS_H */

174
include/ibm/memory.h Normal file
View File

@@ -0,0 +1,174 @@
/* Physical memory layout on IMB compatible PCs. Only the major, fixed memory
* areas are detailed here. Known addresses of the BIOS data area are defined
* in <ibm/bios.h>. The map upper memory area (UMA) is only roughly defined
* since the UMA sections may vary in size and locus.
*
* Created: March 2005, Jorrit N. Herder
*/
/* I/O-mapped peripherals. I/O addresses are different from memory addresses
* due to the I/O signal on the ISA bus. Individual I/O ports are defined by
* the drivers that use them or looked up with help of the BIOS.
*/
#define IO_MEMORY_BEGIN 0x0000
#define IO_MEMORY_END 0xFFFF
/* Physical memory layout. Design decisions made for the earliest PCs, caused
* memory to be broken broken into the following four basic pieces:
* - Conventional or base memory: first 640 KB (incl. BIOS data, see below);
* - Upper Memory Area (UMA): upper 384 KB of the first megabyte of memory;
* - High Memory Area (HMA): ~ first 64 KB of the second megabyte of memory;
* - Extended Memory: all the memory above first megabyte of memory.
* The high memory area overlaps with the first 64 KB of extended memory, but
* is different from the rest of extended memory because it can be accessed
* when the processor is in real mode.
*/
#define BASE_MEM_BEGIN 0x000000
#define BASE_MEM_END 0x09FFFF
#define UPPER_MEM_BEGIN 0x0A0000
#define UPPER_MEM_END 0x0FFFFF
#define HIGH_MEM_BEGIN 0x100000
#define HIGH_MEM_END 0x10FFEF
#define EXTENDED_MEM_BEGIN 0x100000
#define EXTENDED_MEM_END ((unsigned) -1)
/* The logical memory map of the first 1.5 MB is as follows (hexadecimals):
*
* offset [size] (id) = memory usage
* ------------------------------------------------------------------------
* 000000 [00400] (I) = Real-Mode Interrupt Vector Table (1024 B)
* 000400 [00100] (B) = BIOS Data Area (256 B)
* 000800 [00066] (W) = 80286 Loadall workspace
* 010000 [10000] (c) = Real-Mode Compatibility Segment (64 KB)
* 020000 [70000] (.) = Program-accessible memory (free)
* 090000 [10000] (E) = BIOS Extension
* 0A0000 [10000] (G) = Graphics Mode Video RAM
* 0B0000 [08000] (M) = Monochrome Text Mode Video RAM
* 0B8000 [08000] (C) = Color Text Mode Video RAM
* 0C0000 [08000] (V) = Video ROM BIOS (would be "a" in PS/2)
* 0C8000 [18000] (a) = Adapter ROM + special-purpose RAM (free UMA space)
* 0E0000 [10000] (r) = PS/2 Motherboard ROM BIOS (free UMA in non-PS/2)
* 0F0000 [06000] (R) = Motherboard ROM BIOS
* 0F6000 [08000] (b) = IBM Cassette BASIC ROM ("R" in IBM compatibles)
* 0FD000 [02000] (R) = Motherboard ROM BIOS
* 100000 [.....] (.) = Extended memory, program-accessible (free)
* 100000 [0FFEF] (h) = High Memory Area (HMA)
*
*
* Conventional (Base) Memory:
*
* : [~~~~~16 KB~~~~][~~~~~16 KB~~~~][~~~~~16 KB~~~~][~~~~~16 KB~~~~]
* : 0---1---2---3---4---5---6---7---8---9---A---B---C---D---E---F---
* 000000: IBW.............................................................
* 010000: cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
* 020000: ................................................................
* 030000: ................................................................
* 040000: ................................................................
* 050000: ................................................................
* 060000: ................................................................
* 070000: ................................................................
* 080000: ................................................................
* 090000: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
*
* Upper Memory Area (UMA):
*
* : 0---1---2---3---4---5---6---7---8---9---A---B---C---D---E---F---
* 0A0000: GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
* 0B0000: MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
* 0C0000: VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* 0D0000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* 0E0000: rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
* 0F0000: RRRRRRRRRRRRRRRRRRRRRRRRbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbRRRRRRRR
*
* Extended Memory:
*
* : 0---1---2---3---4---5---6---7---8---9---A---B---C---D---E---F---
* 100000: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.
* 110000: ................................................................
* 120000: ................................................................
* 130000: ................................................................
* 140000: ................................................................
* 150000: ................................................................
* 160000: ................................................................
* 170000: ................................................................
*
* Source: The logical memory map was partly taken from the book "Upgrading
* & Repairing PCs Eight Edition", Macmillan Computer Publishing.
*/
/* The bottom part of conventional or base memory is occupied by BIOS data.
* The BIOS memory can be distinguished in two parts:
* o The first the first 1024 bytes of addressable memory contains the BIOS
* real-mode interrupt vector table (IVT). The table is used to access BIOS
* hardware services in real-mode by loading a interrupt vector and issuing
* an INT instruction. Some vectors contain BIOS data that can be retrieved
* directly and are useful in protected-mode as well.
* o The BIOS data area is located directly above the interrupt vectors. It
* comprises 256 bytes of memory. These data are used by the device drivers
* to retrieve hardware details, such as I/O ports to be used.
*/
#define BIOS_MEM_BEGIN 0x00000 /* all BIOS memory */
#define BIOS_MEM_END 0x004FF
#define BIOS_IVT_BEGIN 0x00000 /* BIOS interrupt vectors */
#define BIOS_IVT_END 0x003FF
#define BIOS_DATA_BEGIN 0x00400 /* BIOS data area */
#define BIOS_DATA_END 0x004FF
/* The base memory is followed by 384 KB reserved memory located at the top of
* the first MB of physical memory. This memory is known as the upper memory
* area (UMA). It is used for memory-mapped peripherals, such as video RAM,
* adapter BIOS (adapter ROM and special purpose RAM), and the motherboard
* BIOS (I/O system, Power-On Self Test, bootstrap loader). The upper memory
* can roughly be distinguished in three parts:
*
* o The first 128K of the upper memory area (A0000-BFFFF) is reserved for use
* by memory-mapped video adapters. Hence, it is also called Video RAM. The
* display driver can directly write to this memory and request the hardware
* to show the data on the screen.
*/
#define UMA_VIDEO_RAM_BEGIN 0xA0000 /* video RAM */
#define UMA_VIDEO_RAM_END 0xBFFFF
#define UMA_GRAPHICS_RAM_BEGIN 0xA0000 /* graphics RAM */
#define UMA_GRAPHICS_RAM_END 0xAFFFF
#define UMA_MONO_TEXT_BEGIN 0xB0000 /* monochrome text */
#define UMA_MONO_TEXT_END 0xB7FFF
#define UMA_COLOR_TEXT_BEGIN 0xB8000 /* color text */
#define UMA_COLOR_TEXT_END 0xBFFFF
/* o The next 128K (the memory range C0000-DFFFF) is reserved for the adapter
* BIOS that resides in the ROM on some adapter boards. Most VGA-compatible
* video adapters use the first 32 KB of this area for their on-board BIOS.
* The rest can be used by any other adapters. The IDE controller often
* occupies the second 32 KB.
*/
#define UMA_ADAPTER_BIOS_BEGIN 0xC0000 /* adapter BIOS */
#define UMA_ADAPTER_BIOS_END 0xDFFFF
#define UMA_VIDEO_BIOS_BEGIN 0xC0000 /* video adapter */
#define UMA_VIDEO_BIOS_END 0xC7FFF
#define UMA_IDE_HD_BIOS_BEGIN 0xC8000 /* IDE hard disk */
#define UMA_IDE_HD_BIOS_END 0xCBFFF
/* o The last 128K of the upper memory area (E0000-FFFFF) is reserved for
* motherboard BIOS (Basic I/O System). The POST (Power-On Self Test) and
* bootstrap loader also reside in this space. The memory falls apart in
* two areas: Plug & Play BIOS data and the system BIOS data.
*/
#define UMA_MB_BIOS_BEGIN 0xE0000 /* motherboard BIOS */
#define UMA_MB_BIOS_END 0xFFFFF
#define UMA_PNP_ESCD_BIOS_BEGIN 0xE0000 /* PnP extended data */
#define UMA_PNP_ESCD_BIOS_END 0xEFFFF
#define UMA_SYSTEM_BIOS_BEGIN 0xF0000 /* system BIOS */
#define UMA_SYSTEM_BIOS_END 0xFFFFF

View File

@@ -45,7 +45,7 @@
#define CTRLR(n) (NONE + (n))
/* User-level processes, that is, device drivers, servers, and INIT. */
#define MM_PROC_NR 0 /* memory manager */
#define PM_PROC_NR 0 /* process manager */
#define FS_PROC_NR 1 /* file system */
#define IS_PROC_NR 5 /* information server */
#define TTY 6 /* terminal (TTY) driver */
@@ -130,12 +130,11 @@
# define NULL_DEV 3 /* minor device for /dev/null */
# define BOOT_DEV 4 /* minor device for /dev/boot */
# define RANDOM_DEV 5 /* minor device for /dev/random */
# define URANDOM_DEV 6 /* minor device for /dev/urandom */
# define ZERO_DEV 6 /* minor device for /dev/zero */
/* Full device numbers that are special to the boot monitor and FS. */
# define DEV_RAM 0x0100 /* device number of /dev/ram */
# define DEV_BOOT 0x0104 /* device number of /dev/boot */
# define DEV_RANDOM 0x0105 /* device number of /dev/random */
# define DEV_URANDOM 0x0106 /* device number of /dev/urandom */
/*===========================================================================*
@@ -204,40 +203,40 @@
* modifying the system call numbers. The numbers here determine which call
* is made from the call vector.
*/
#define NR_SYS_CALLS 32 /* number of system calls */
#define NR_SYS_CALLS 33 /* number of system calls */
# define SYS_TIMES 0 /* sys_times(proc_nr, bufptr) */
# define SYS_XIT 1 /* sys_xit(parent, proc) */
# define SYS_GETSIG 2 /* sys_getsig(proc_nr, sig_map) */
# define SYS_SIGCTL 3 /* sys_sigctl(req,pnr,sig,ctxt,flag,pnr,map) */
# define SYS_FORK 4 /* sys_fork(parent, child, pid) */
# define SYS_NEWMAP 5 /* sys_newmap(proc_nr, map_ptr) */
# define SYS_COPY 6 /* sys_copy(ptr) */
# define SYS_ENDSIG 6 /* sys_endsig(proc_nr) */
# define SYS_EXEC 7 /* sys_exec(proc_nr, new_sp) */
# define SYS_SIGSEND 8 /* sys_sigsend(proc_nr, ctxt_ptr) */
# define SYS_ABORT 9 /* sys_abort() */
# define SYS_KILL 10 /* sys_kill(proc_nr, sig) */
# define SYS_UMAP 11 /* sys_umap(proc_nr, etc) */
# define SYS_RANDOM 12 /* sys_random(...) */
# define SYS_TRACE 13 /* sys_trace(req,pid,addr,data) */
# define SYS_VCOPY 14 /* sys_vcopy(src_p, dst_p, vcpy_s, vcpy_ptr) */
# define SYS_SIGNALRM 15 /* sys_signalrm(proc_nr, ticks) */
# define SYS_SYNCALRM 16 /* sys_syncalrm(proc_nr,exp_time,abs_time) */
# define SYS_FLAGALRM 17 /* sys_flagalrm(ticks, flag_ptr) */
# define SYS_SVRCTL 19 /* sys_svrctl(proc_nr, req, argp) */
# define SYS_SDEVIO 20 /* sys_sdevio(port, proc_nr, buf, count) */
# define SYS_SIGRETURN 21 /* sys_sigreturn(proc_nr, ctxt_ptr, flags) */
# define SYS_GETINFO 22 /* sys_getinfo(what, whereto) */
# define SYS_DEVIO 23 /* sys_devio(port, value) */
# define SYS_VDEVIO 24 /* sys_vdevio(buf_ptr, nr_ports) */
# define SYS_IRQCTL 25 /* sys_irqctl() */
# define SYS_KMALLOC 26 /* sys_kmalloc(size, phys_base) */
# define SYS_IOPENABLE 27 /* sys_enable_iop() */
# define SYS_PHYS2SEG 28 /* sys_phys2seg(*seg, *off, phys) */
# define SYS_SEGCTL 28 /* sys_segctl(*idx, *seg, *off, phys, size) */
# define SYS_EXIT 29 /* sys_exit(status) */
# define SYS_VIRCOPY 30 /* sys_vircopy(src,seg,addr,dst,seg,addr,cnt) */
# define SYS_PHYSCOPY 31 /* sys_physcopy(src_addr,dst_addr,count) */
# define SYS_MSTATS 32
# define SYS_VIRVCOPY 32 /* sys_virvcopy(vec_ptr, vec_size) */
/* Field names for SYS_MEM, SYS_KMALLOC. */
#define MEM_CHUNK_BASE m4_l1 /* physical base address */
@@ -289,11 +288,12 @@
/* Names of message field and paramaters for SYS_EXIT request. */
#define EXIT_STATUS m2_i1 /* zero for normal exit, non-zero else */
/* Field names for SYS_PHYS2SEG. */
/* Field names for SYS_SEGCTL. */
#define SEG_SELECT m4_l1 /* segment selector returned */
#define SEG_OFFSET m4_l2 /* offset in segment returned */
#define SEG_PHYS m4_l3 /* physical address of segment */
#define SEG_SIZE m4_l4 /* segment size */
#define SEG_INDEX m4_l5 /* segment index in remote map */
/* Field names for SYS_VIDCOPY. */
#define VID_REQUEST m4_l1 /* what to do? */
@@ -310,7 +310,7 @@
#define ABRT_MON_LEN m1_i3 /* length of monitor params */
#define ABRT_MON_ADDR m1_p1 /* virtual address of monitor params */
/* Field names for SYS_COPY, _UMAP, _VIRCOPY, _PHYSCOPY. */
/* Field names for _UMAP, _VIRCOPY, _PHYSCOPY. */
#define CP_SRC_SPACE m5_c1 /* T or D space (stack is also D) */
#define CP_SRC_PROC_NR m5_i1 /* process to copy from */
#define CP_SRC_ADDR m5_l1 /* address where data come from */
@@ -327,7 +327,7 @@
/* Field names for SYS_GETINFO. */
#define I_REQUEST m7_i3 /* what info to get */
# define GET_KENVIRON 0 /* get kernel environment variables */
# define GET_KINFO 0 /* get kernel information structure */
# define GET_IMAGE 1 /* get system image table */
# define GET_PROCTAB 2 /* get (kernel) process table */
# define GET_PROCNR 3 /* find nr of process with name */
@@ -339,6 +339,7 @@
# define GET_KADDRESSES 9 /* get various kernel addresses */
# define GET_SCHEDINFO 10 /* get scheduling queues */
# define GET_PROC 11 /* get process slot if given process */
# define GET_MACHINE 12 /* get machine information */
#define I_PROC_NR m7_i4 /* calling process */
#define I_VAL_PTR m7_p1 /* virtual address at caller */
#define I_VAL_LEN m7_i1 /* max length of value */

View File

@@ -38,7 +38,7 @@
#endif
#if (MACHINE == IBM_PC && _WORD_SIZE == 4)
#define NR_BUFS 128 /* # blocks in the buffer cache */
#define NR_BUFS 1024 /* # blocks in the buffer cache */
#define NR_BUF_HASH 1024 /* size of buf hash table; MUST BE POWER OF 2*/
#endif
@@ -52,7 +52,7 @@
#define LINEWRAP 1 /* console.c - wrap lines at column 80 */
#define ALLOW_GAP_MESSAGES 1 /* proc.c - allow messages in the gap between
* the end of bss and lowest stack address */
#define KMESS_BUF_SIZE 512 /* size in B for kernel messages */
#define KMESS_BUF_SIZE 512 /* size in bytes for kernel messages */
/* Number of controller tasks (/dev/cN device classes). */
#define NR_CTRLRS 2
@@ -65,7 +65,10 @@
/* Enable or disable kernel calls (allows for minimal kernel). */
#define ENABLE_K_TRACING 1 /* process tracing can be disabled */
#define ENABLE_K_DEBUGGING 1 /* kernel debugging calls */
#define ENABLE_K_DEBUGGING 0 /* kernel debugging calls */
/* Include or exclude an image of /dev/boot in the boot image. */
#define ENABLE_BOOTDEV 1
/* Include or exclude device drivers. Set to 1 to include, 0 to exclude. */
#define ENABLE_BIOS_WINI 0 /* enable BIOS winchester driver */
@@ -110,8 +113,7 @@
* ENABLE_USERPRIV must be set to 1 to allow the features anyway.
*/
#define ENABLE_USERBIOS 0 /* enable user mode BIOS calls */
#define ENABLE_LOOSELDT 0 /* allow imprecise, page based LDT entries */
#define ENABLE_USERIOPL 1 /* enable CPU's IOPL bits for /dev/(k)mem */
#define ENABLE_USERIOPL 0 /* enable CPU's IOPL bits for /dev/(k)mem */
/* NR_CONS, NR_RS_LINES, and NR_PTYS determine the number of terminals the
* system can handle.

View File

@@ -42,6 +42,8 @@
#define BIOS_SEG 0x0200 /* flags indicating BIOS memory segment */
#define NR_BIOS_SEGS 3 /* # BIOS memory regions (variable) */
#define PHYS_SEG 0x0300 /* flag indicating entire physical memory */
/* Labels used to disable code sections for different reasons. */
#define DEAD_CODE 0 /* unused code in normal configuration */
#define FUTURE_CODE 0 /* new code to be activated + tested later */

View File

@@ -11,7 +11,7 @@
* Sep 02, 2004 added sys_exit (Jorrit N. Herder)
* Aug 15, 2004 added sys_getinfo (Jorrit N. Herder)
* Jul 23, 2004 added sys_umap (Jorrit N. Herder)
* Jul 13, 2004 added sys_enable_iop, sys_phys2seg (Jorrit N. Herder)
* Jul 13, 2004 added sys_enable_iop, sys_segctl (Jorrit N. Herder)
* Mar 20, 2004 added sys_devio, sys_vdevio (Jorrit N. Herder)
*/
@@ -41,8 +41,6 @@ _PROTOTYPE( int _taskcall, (int who, int syscallnr, message *msgptr) );
_PROTOTYPE( int sys_abort, (int how, ...) );
_PROTOTYPE( int sys_adjmap, (int proc, struct mem_map *ptr,
vir_clicks data_clicks, vir_clicks sp) );
_PROTOTYPE( int sys_copy, (int src_proc, int src_seg, phys_bytes src_vir,
int dst_proc, int dst_seg, phys_bytes dst_vir, phys_bytes bytes));
_PROTOTYPE( int sys_exec, (int proc, char *ptr, int traced,
char *aout, vir_bytes initpc) );
_PROTOTYPE( int sys_execmap, (int proc, struct mem_map *ptr) );
@@ -54,14 +52,9 @@ _PROTOTYPE( int sys_times, (int proc_nr, clock_t *ptr) );
_PROTOTYPE( int sys_getuptime, (clock_t *ticks) );
_PROTOTYPE( int sys_trace, (int req, int proc, long addr, long *data_p) );
_PROTOTYPE( int sys_xit, (int parent, int proc) );
_PROTOTYPE( int sys_kill, (int proc, int sig) );
_PROTOTYPE( int sys_svrctl, (int proc, int req, int priv,vir_bytes argp));
/*==========================================================================*
* New prototypes since MINIX release 2 (Jorrit N. Herder) *
*==========================================================================*/
/* Shorthands for sys_sdevio() system call. */
#define sys_insb(port, proc_nr, buffer, count) \
sys_sdevio(DIO_INPUT, port, DIO_BYTE, proc_nr, buffer, count)
@@ -89,7 +82,7 @@ _PROTOTYPE(int sys_syncalrm, (int proc_nr, clock_t exp_time, int abs_time) );
_PROTOTYPE ( int sys_irqctl, (int request, int irq_vec, int policy,
int proc_nr, long port, void *val_ptr, long mask_val) );
/* Shorthands for sys_vircopy() system call. */
/* Shorthands for sys_vircopy() and sys_physcopy() system calls. */
#define sys_biosin(bios_vir, dst_vir, bytes) \
sys_vircopy(SELF, BIOS_SEG, bios_vir, SELF, D, dst_vir, bytes)
#define sys_biosout(src_vir, bios_vir, bytes) \
@@ -103,17 +96,22 @@ _PROTOTYPE ( int sys_irqctl, (int request, int irq_vec, int policy,
_PROTOTYPE(int sys_vircopy, (int src_proc, int src_seg, vir_bytes src_vir,
int dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes) );
_PROTOTYPE(int sys_physcopy, (phys_bytes src_phys, phys_bytes dst_phys,
phys_bytes bytes) );
#define sys_abscopy(src_phys, dst_phys, bytes) \
sys_physcopy(NONE, PHYS_SEG, src_phys, NONE, PHYS_SEG, dst_phys, bytes)
_PROTOTYPE(int sys_physcopy, (int src_proc, int src_seg, vir_bytes src_vir,
int dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes) );
_PROTOTYPE(int sys_umap, (int proc_nr, int seg, vir_bytes vir_addr,
vir_bytes bytes, phys_bytes *phys_addr) );
_PROTOTYPE(int sys_phys2seg, (u16_t *seg,vir_bytes *off,phys_bytes phys, vir_bytes size));
_PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
phys_bytes phys, vir_bytes size));
_PROTOTYPE(int sys_enable_iop, (int proc_nr) );
_PROTOTYPE(int sys_kmalloc, (size_t size, phys_bytes *phys_base) );
/* Shorthands for sys_getinfo() system call. */
#define sys_getkmessages(dst) sys_getinfo(GET_KMESSAGES, dst, 0,0,0)
#define sys_getkenviron(dst) sys_getinfo(GET_KENVIRON, dst, 0,0,0)
#define sys_getkinfo(dst) sys_getinfo(GET_KINFO, dst, 0,0,0)
#define sys_getmachine(dst) sys_getinfo(GET_MACHINE, dst, 0,0,0)
#define sys_getproctab(dst) sys_getinfo(GET_PROCTAB, dst, 0,0,0)
#define sys_getproc(dst,nr) sys_getinfo(GET_PROC, dst, 0,0, nr)
#define sys_getprocnr(dst,k,kl) sys_getinfo(GET_PROCNR, dst, 0,k,kl)
@@ -129,17 +127,12 @@ _PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
_PROTOTYPE(int sys_exit, (int status) );
/* Shorthands for sys_sigctl() system call. */
#define sys_getsig(proc_nr, sig_map) \
sys_sigctl(S_GETSIG, 0,0,0, proc_nr, sig_map)
#define sys_endsig(proc_nr) \
sys_sigctl(S_ENDSIG, proc_nr, 0,0,0,0)
#define sys_sendsig(proc_nr, sig_ctxt) \
sys_sigctl(S_SENDSIG, proc_nr, sig_ctxt, 0,0,0)
#define sys_sigreturn(proc_nr, sig_ctxt, flags) \
sys_sigctl(S_SIGRETURN, proc_nr, sig_ctxt, flags, 0,0)
_PROTOTYPE(int sys_sigctl, (int request, int proc_nr, struct sigmsg *sig_ctxt,
int flags, int *k_proc_nr, sigset_t *k_sig_map) );
/* Signal control. */
_PROTOTYPE(int sys_kill, (int proc, int sig) );
_PROTOTYPE(int sys_sigsend, (int proc_nr, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_sigreturn, (int proc_nr, struct sigmsg *sig_ctxt, int flags) );
_PROTOTYPE(int sys_getsig, (int *k_proc_nr, sigset_t *k_sig_map) );
_PROTOTYPE(int sys_endsig, (int proc_nr) );
/* NOTE: two different approaches were used to distinguish the device I/O
* types 'byte', 'word', 'long': the latter uses #define and results in a

View File

@@ -22,17 +22,33 @@ typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
#endif
/* Memory map for local text, stack, data segments. */
struct mem_map {
vir_clicks mem_vir; /* virtual address */
phys_clicks mem_phys; /* physical address */
vir_clicks mem_len; /* length */
};
/* Memory map for remote memory areas, e.g., for the RAM disk. */
struct far_mem {
int in_use; /* entry in use, unless zero */
phys_clicks mem_phys; /* physical address */
vir_clicks mem_len; /* length */
};
/* Structure for virtual copying by means of a vector with requests. */
struct vir_addr {
int proc_nr;
int segment;
vir_bytes offset;
};
struct vir_cp_req {
struct vir_addr src;
struct vir_addr dst;
phys_bytes count;
};
typedef struct {
vir_bytes iov_addr; /* address of an I/O buffer */
vir_bytes iov_size; /* sizeof an I/O buffer */
@@ -74,20 +90,28 @@ struct psinfo { /* information for the ps(1) program */
};
/* This is used to obtain system information through SYS_GETINFO. */
struct kenviron {
struct kinfo {
phys_bytes code_base; /* base of kernel code */
phys_bytes code_size;
phys_bytes data_base; /* base of kernel data */
phys_bytes data_size;
vir_bytes proc_addr; /* virtual address of process table */
phys_bytes kmem_base; /* kernel memory layout (/dev/kmem) */
phys_bytes kmem_size;
phys_bytes bootdev_base; /* boot device from boot image (/dev/boot) */
phys_bytes bootdev_size;
phys_bytes params_base; /* parameters passed by boot monitor */
phys_bytes params_size;
char version[8]; /* kernel version number */
};
struct machine {
int pc_at;
int ps_mca;
int processor;
int protected;
int ega;
int vga;
vir_bytes proc_addr; /* virtual address of process table */
phys_bytes kmem_base; /* kernel memory layout (/dev/kmem) */
phys_bytes kmem_size;
phys_bytes bootfs_base; /* FS image from boot image (/dev/boot) */
phys_bytes bootfs_size;
phys_bytes params_base; /* parameters passed by boot monitor */
phys_bytes params_size;
int vdu_ega;
int vdu_vga;
};
/* The kernel outputs messages in a local buffer, which can be requested and