Skip to content

Commit b9440c7

Browse files
committed
additional comments
1 parent db43a4b commit b9440c7

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

kernel/kernel.asm

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -848,16 +848,23 @@ int24_esbp times 2 dw 0 ;260 - pointer to criticalerr DPB
848848
global _user_r, int21regs_off, int21regs_seg
849849
_user_r:
850850
int21regs_off dw 0 ;264 - pointer to int21h stack frame
851-
int21regs_seg dw 0
851+
int21regs_seg dw 0 ; i.e. points stack frame (SS:SP) with user registers when int21h called
852852
global critical_sp
853-
critical_sp dw 0 ;268 - critical error internal stack
853+
critical_sp dw 0 ;268 - critical error internal stack, store SP during int24h
854854
global current_ddsc
855-
current_ddsc times 2 dw 0
855+
current_ddsc times 2 dw 0 ;26A - pointer to DPB for ???
856+
857+
diskbuf_seg dw 0 ;26E - segment of disk buffer
858+
dd 0 ;270 - saving partial cluster number??? - see https://faydoc.tripod.com/structures/16/1690.htm
859+
dw 0
860+
dw 0 ;276 - temp word
861+
db 0 ;278 - media id returned by AH=1Bh,1Ch
862+
db 0 ;279 - unused
856863

857864
; Pad to 059ah
858865
times (27ah - ($ - _internal_data)) db 0
859866
global current_device
860-
current_device times 2 dw 0 ;27A - 0??
867+
current_device times 2 dw 0 ;27A - point to device header if filename is character device
861868
global _lpCurSft
862869
_lpCurSft times 2 dw 0 ;27e - Current SFT
863870
global _current_ldt
@@ -867,11 +874,14 @@ _sda_lpFcb times 2 dw 0 ;286 - pointer to callers FCB
867874
global _current_sft_idx
868875
_current_sft_idx dw 0 ;28A - SFT index for next open
869876
; used by MS NET
877+
dw 0 ;28C - temp file handler
878+
dd 0 ;28E - pointer to JFT entry (for file being opened) in process handle table
870879

871880
; Pad to 05b2h
872881
times (292h - ($ - _internal_data)) db 0
873882
dw __PriPathBuffer ; 292 - "sda_WFP_START" offset in DOS DS of first filename argument
874883
dw __SecPathBuffer ; 294 - "sda_REN_WFP" offset in DOS DS of second filename argument
884+
dw ffffh ; 296 - 0xffff or offset of last component in filename
875885

876886
; Pad to 05ceh
877887
times (2aeh - ($ - _internal_data)) db 0
@@ -884,22 +894,23 @@ _current_filepos times 2 dw 0 ;2AE - current offset in file
884894
;global _save_DS
885895
save_BX dw 0 ;2CA - unused by FreeDOS, for Win3.x
886896
save_DS dw 0 ; compatibility, match MS's positions
887-
dw 0
897+
dw 0 ; store DS,BX on entry to int21h (ie caller's values)
888898
global _prev_user_r
889899
global prev_int21regs_off
890900
global prev_int21regs_seg
891901
_prev_user_r:
892-
prev_int21regs_off dw 0 ;2D0 - pointer to prev int 21 frame
902+
prev_int21regs_off dw 0 ;2D0 - pointer to prev int 21 frame (see offset 264h)
893903
prev_int21regs_seg dw 0
894904

895-
; Pad to 05fdh
905+
; Pad to 05fdh, 2D4 through 2E4 used for int21h/ax=6C00h
896906
times (2ddh - ($ - _internal_data)) db 0
897907
global _ext_open_action
898908
global _ext_open_attrib
899909
global _ext_open_mode
900910
_ext_open_action dw 0 ;2DD - extended open action
901911
_ext_open_attrib dw 0 ;2DF - extended open attrib
902912
_ext_open_mode dw 0 ;2E1 - extended open mode
913+
open_filename dd 0 ;2E3 pointer to filename to open (see ax=6C00h)
903914

904915
; Pad to 0620h
905916
times (300h - ($ - _internal_data)) db 0
@@ -916,6 +927,7 @@ _SearchDir_ren: times 32 db 0x90 ;315 - 32 byte dir entry for rename
916927
; stacks are made to initialize to no-ops so that high-water
917928
; testing can be performed
918929
times STACK_SIZE*2-($-apistk_bottom) db 0x90
930+
; critical error stack 331 bytes?, disk stack 384 bytes, character i/o 384 bytes
919931
;300 - Error Processing Stack
920932
global _error_tos
921933
_error_tos:
@@ -926,13 +938,23 @@ _disk_api_tos:
926938
global _char_api_tos
927939
_char_api_tos:
928940
apistk_top:
929-
db 0 ; 780 ???
941+
db 0 ;780 device driver look-ahead (printer), see ah=64h
930942
_VolChange db 0 ;781 - volume change
931943
_VirtOpen db 0 ;782 - virtual open flag
932944

945+
; 783h to 788h are fastseek drive, 1st cluster, logical cluster, returned logical cluster
946+
; 78Ah dw ? temp location of SYSINIT
947+
933948
; controlled variables end at offset 78Ch so pad to end
934949
times (78ch - ($ - _internal_data)) db 0
935950

951+
; MSDOS 7.1+ with FAT32 SDA extended
952+
;78Ch - 47 bytes of ???
953+
times (7bbh - ($ - _internal_data)) db 0
954+
absrdwrflg db 0 ;7bbh - 0=int 25h/26h absolute read/write, 1=int 21h/ax=7305h
955+
times 12 dw 0 ;7bch to 7d2h, high word of 32bit values, see offsets 0x 2a2, 29c, 2bc, 29a, 276, 244, & registers ebx,edx,edi,ecx
956+
times 3 dw 0 ; ???
957+
936958
;
937959
; end of controlled variables
938960
;

0 commit comments

Comments
 (0)