en:docs:kernel:doskrnl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
en:docs:kernel:doskrnl [2023/11/26 14:29] prokusheven:docs:kernel:doskrnl [2024/05/25 02:39] prokushev
Line 1: Line 1:
 +{{page>en:templates:dosint}}
 +
 ====== DOSKRNL ====== ====== DOSKRNL ======
  
-DOSKRNL is a specialized DOS kernel changed to support DOS in MVM.+DOSKRNL is a specialized FreeDOS kernel changed to support DOS in MVM. Mostly all FAT code removed as well as CONFIG.SYS parser. So it smaller in compare with original FreeDOS kernel. Also image format changed from exe to raw binary because slightly different load logic.
  
-===== Startup =====+===== Initialization =====
  
-On DOSKRNL start SS:BP contains some structure which contains initial information for DOS kernel. Exact structure format not know. SS:SP contains stack pointer (initially point to area after init structure, size around 400 bytes)+DOSKRNL loaded at address differ from standard DOS 0060:0000 address, but at 0070:0000. osFree DOSKRNL expects unknown load address, but in low address of conventional memory. Refer [[https://archive.org/download/IBMOS2TechnicalDocumentation/KGUIDE20.PDF|OS/2 v 2.0 Kernel Design Guide]] for memory map and initialization information. 
 + 
 +On DOSKRNL startup registers are following: 
 + 
 +  * CS:IP - starting point 
 +  * SS:BP - pointer to the DOSKRNL init structure (also referenced as VDOS init in IBM documents) 
 +  * SS:SP stack pointer (size around 800 bytes) 
 + 
 +Interrupts disabled. 
 + 
 +DOSKRNL init structure:
  
 ^ Offset ^ Size ^ Description ^ ^ Offset ^ Size ^ Description ^
Line 11: Line 23:
 | 2      | 2    | Size of memory - first free segment (paragraphs) | | 2      | 2    | Size of memory - first free segment (paragraphs) |
 | 4      | 2    | Size of init area (paragraphs)| | 4      | 2    | Size of init area (paragraphs)|
-????   ???  Unknown +6      2    Value of BREAK setting |  
-| 22     | 4    | Pointer to linked list of VDD | +| 8      | 2    | Value of DOS setting |  
-25     | 1    | Current drive (0-A, 1-B,...)| +| 10     | 4    | Far pointer to list of DOS DEVICE setting | 
-26     | 1    | Boot drive (0-A, 1-B,...) |+| 14     | 4    | Far pointer to SHELL (filepath only) | 
 +| 18     | 4    | Far pointer to SHELL (arguments) 
 +| 22     | 4    | Far pointer to linked list of VDD | 
 +26     | 1    | Current drive (1-A, 2-B, 3-C, ...)| 
 +27     | 1    | Boot drive (1-A, 2-B, 3-C, ...) | 
 +| 28     | 1    | Last drive (1-A, 2-B, 3-C, ...) 
 +| ???    | ???  | ??? |
  
 +DEVICES is ASCIIZ string with list of DOS devices to be loaded divided by 0AH
 +
 +SHELL is ASCIIZ string.
 +
 +SHELL arguments is ASCIIZ string (first byte is a string length, string ends with 0dh)
 +
 +VDD is linked list of structures:
 +
 +VDDs linked list in standard DOS Device drivers format. Entry can be placed in HMA, so need to be sure A20 enabled for such entries. Named as DOSDDTYPE in DDK
 +
 +^ offset ^ Size ^ Description ^
 +|  0      4  | Pointer to next device (Must be set to -1 for last device)  |
 +|  4      2  | Attributes                      |
 +| :::    | ::: | Bit 15 = 1 if char device 0 if blk     |
 +| :::    | ::: |  if bit 15 is 1                        |
 +| :::    | ::: |    Bit 0 = 1 if Current STDIN device     |
 +| :::    | ::: |    Bit 1 = 1 if Current STDOUT output     |
 +| :::    | ::: |    Bit 2 = 1 if Current NULL device     |
 +| :::    | ::: |    Bit 3 = 1 if Current CLOCK device      |
 +| :::    | ::: |    Bit 4 = 1 if SPECIAL                |
 +| :::    | ::: |  Bit 14 is the IOCTL bit               |
 +| :::    | ::: |  Bit 13 is the NON IBM FORMAT bit      |
 +|  6      2  | Pointer to Device strategy entry point |
 +|  8      2  | Pointer to Device interrupt entry point |
 +|  10    |  8  | character device name field. Character devices set a device name. For block devices the first byte is the number of units |
  
 Memory map on DOSKRNL start: Memory map on DOSKRNL start:
Line 21: Line 64:
 | Init area         | [BP+0+BP+2-BP+4]:0 | | Init area         | [BP+0+BP+2-BP+4]:0 |
 | Free              | [BP+0]:0 | | Free              | [BP+0]:0 |
-| DOSKRNL           60:0 |+| DOSKRNL           ???:0 
 +| Some data (VDD entries was found here) | ??? |
 | CMOS Data         | 40:0 | | CMOS Data         | 40:0 |
 | Interrupt vectors | 0:0  | | Interrupt vectors | 0:0  |
  
-As in most DOS kernels, DOSKRNL moves initialization code to higher memory. But uses init structure, not BIOS INT 12h, for memory information. +As in most DOS kernels, DOSKRNL moves initialization code to higher conventional memory. But uses init structure, not BIOS INT 12h, for memory information.
- +
-VDDs linked list (in init area) in standard DOS Device drivers format +
- +
-^ offset ^ Size ^ Description ^ +
-|  0     | DWORD | Pointer to next device (Must be set to -1 for last device) +
-|  4     | WORD  | Attributes                      | +
-| :::   | Bit 15 = 1 if char device 0 if blk     | +
-| :::    if bit 15 is 1                        | +
-| :::      Bit 0 = 1 if Current sti device     | +
-| :::      Bit 1 = 1 if Current sto output     | +
-| :::      Bit 2 = 1 if Current NUL device     | +
-| :::      Bit 3 = 1 if Current CLOCK dev      | +
-| :::      Bit 4 = 1 if SPECIAL                | +
-| :::    Bit 14 is the IOCTL bit               | +
-| :::    Bit 13 is the NON IBM FORMAT bit      | +
-|  6    | WORD  | Pointer to Device strategy entry point | +
-|  8    | WORD  | Pointer to Device interrupt entry point | +
-| 0ah   | 8-BYTE | character device name field. Character devices set a device name. For block devices the first byte is the number of units |+
  
 DOSKRNL search and initialize XMS driver and moves some parts to HMA. Most other initialization things is same. DOSKRNL initializes standard device drivers and adds and initializes VDDs, passed via init structure. Some things (at least COMMAND.COM, device drivers) also passed via init structure. not CONFIG.SYS. At the present time interface not investigated well. DOSKRNL search and initialize XMS driver and moves some parts to HMA. Most other initialization things is same. DOSKRNL initializes standard device drivers and adds and initializes VDDs, passed via init structure. Some things (at least COMMAND.COM, device drivers) also passed via init structure. not CONFIG.SYS. At the present time interface not investigated well.
Line 55: Line 81:
   * SHELL   * SHELL
   * DOS   * DOS
 +  * BREAK
 +  * FCBS
 +  * LASTDRIVE
  
 todo add more info here todo add more info here
  
 +Also most of these setting can be adjusted via DOS Properties (aka DOS Settings). Refer [[https://archive.org/download/gg243731/gg243731_OS2_V2_0_Vol_2_DOS_and_Windows_Environment.pdf|OS/2 Version 2.0 Volume 2: DOS and Windows Environment]] for more information.
 +
 +===== Properties =====
 +
 +  * COM_DIRECT_ACCESS
 +  * COM_HOLD
 +  * COM_RECEIVE_BUFFER_FLUSH
 +  * COM_SELECT
 +  * DOS_AUTOEXEC
 +  * DOS_BACKGROUND_EXECUTION
 +  * DOS_BREAK
 +  * DOS_DEVICE
 +  * DOS_FCBS
 +  * DOS_FCBS_KEEP
 +  * DOS_FILES
 +  * DOS_HIGH
 +  * DOS_LASTDRIVE
 +  * DOS_RMSIZE
 +  * DOS_SHELL
 +  * DOS_STARTUP_DRIVE
 +  * DOS_UMB
 +  * DOS_VERSION
 +  * DPMI_DOS_API
 +  * DPMI_MEMORY_LIMIT
 +  * DPMI_NETWORK_BUFF_SIZE
 +  * EMS_FRAME_LOCATION
 +  * EMS_HIGH_OS_MAP_REGION
 +  * EMS_LOW_OS_MAP_REGION
 +  * EMS_MEMORY_LIMIT
 +  * HW_NOSOUND
 +  * HW_ROM_TO_RAM
 +  * HW_TIMER
 +  * IDLE_SECONDS
 +  * IDLE_SENSITIVITY
 +  * INT_DURING_IO
 +  * KBD_ALTHOME_BYPASS
 +  * KBD_BUFFER_EXTEND
 +  * KBD_CTRL_BYPASS
 +  * KBD_RATE_LOCK
 +  * MEM_EXCLUDE_REGION
 +  * MEM_INCLUDE_REGION
 +  * MOUSE_EXCLUSIVE_ACCESS
 +  * PRINT_SEPARATE_OUTPUT
 +  * PRINT_TIMEOUT
 +  * SESSION_PRIORITY
 +  * VIDEO_8514A_XGA_IOTRAP
 +  * VIDEO_FASTPASTE
 +  * VIDEO_MODE_RESTRICTIONS
 +  * VIDEO_ONDEMAND_MEMORY
 +  * VIDEO_RETRACE_EMULATION
 +  * VIDEO_ROM_EMULATION
 +  * VIDEO_SWITCH_NOTIFICATION
 +  * VIDEO_WINDOW_REFRESH
 +  * XMS_HANDLES
 +  * XMS_MEMORY_LIMIT
 +  * XMS_MINIMUM_HMA 
  
 ===== API ===== ===== API =====