aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2009-03-22 00:27:56 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-03-21 22:22:35 -0700
commit6343407b927e9b0a67a8c11dbc3e2b6f78fe23f9 (patch)
treea03d9be2f66c8bd0df86f53609197e55650001d0 /memdisk
parenta3b31baff2a6c0a32e7e28294804b82db4f7a3f1 (diff)
downloadsyslinux.git-6343407b927e9b0a67a8c11dbc3e2b6f78fe23f9.tar.gz
syslinux.git-6343407b927e9b0a67a8c11dbc3e2b6f78fe23f9.tar.xz
syslinux.git-6343407b927e9b0a67a8c11dbc3e2b6f78fe23f9.zip
memdisk: additional comments in memdisk.inc and postprocess.pl
Just a sprinkling of comments adding further description to the code.
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/memdisk.inc34
-rwxr-xr-xmemdisk/postprocess.pl6
2 files changed, 25 insertions, 15 deletions
diff --git a/memdisk/memdisk.inc b/memdisk/memdisk.inc
index 1e2076bd..0df6c770 100644
--- a/memdisk/memdisk.inc
+++ b/memdisk/memdisk.inc
@@ -36,6 +36,7 @@
%endif ; DEBUG_TRACERS
+; Flags we test our configuration against
%define CONFIG_READONLY 0x01
%define CONFIG_RAW 0x02
%define CONFIG_SAFEINT 0x04
@@ -104,6 +105,8 @@ Int13Start:
xor dl,[cs:DriveNo]
pop dx
js .nomatch ; If SF=0, we have a class match here
+ ; 0x00 the sign bit for FD
+ ; 0x80 the sign bit for HD
jz .our_drive ; If ZF=1, we have an exact match
cmp dl,[cs:DriveNo]
jb .nomatch ; Drive < Our drive
@@ -115,13 +118,13 @@ Int13Start:
pushf
push bp
mov bp,sp
- cmp byte [cs:SavedAX+1],08h
+ cmp byte [cs:SavedAX+1],08h ; Get drive params function?
je .norestoredl
- cmp byte [cs:SavedAX+1],15h
+ cmp byte [cs:SavedAX+1],15h ; Get disk type function?
jne .restoredl
test byte [bp+4],80h ; Hard disk?
jnz .norestoredl
-.restoredl:
+.restoredl: ; DL should have number of drives
mov dl,[bp+4]
.norestoredl:
push ax
@@ -129,7 +132,7 @@ Int13Start:
push ds
mov ax,[bp+2] ; Flags
lds ebx,[cs:Stack]
- mov [bx+4],al ; Arithmetric flags
+ mov [bx+4],al ; Arithmetic flags
pop ds
pop ebx
pop ax
@@ -166,7 +169,7 @@ DoneWeird:
and ah,ah
lds ebx,[Stack]
- ; This sets the low byte (the arithmetric flags) of the
+ ; This sets the low byte (the arithmetic flags) of the
; FLAGS on stack to either 00h (no flags) or 01h (CF)
; depending on if AH was zero or not.
setnz [bx+4] ; Set CF iff error
@@ -181,7 +184,8 @@ Reset:
TRACER 'R'
xor ax,ax ; Bottom of memory
mov es,ax
- test dl,dl ; Always pass it on if we are resetting HD
+ test dl,dl ; Always pass it on if we are
+ ; resetting HD
js .hard_disk ; Bit 7 set
; Some BIOSes get very unhappy if we pass a reset floppy
; command to them and don't actually have any floppies.
@@ -194,7 +198,8 @@ Reset:
jmp .pass_on ; ... otherwise pass it to the BIOS
.hard_disk:
; ... same thing for hard disks, sigh ...
- cmp byte [es:0x475],1 ; BIOS variable for number of hard disks
+ cmp byte [es:0x475],1 ; BIOS variable for number of hard
+ ; disks
jbe success
.pass_on:
@@ -354,7 +359,7 @@ EDDWrite:
TRACER 'w'
call edd_setup_regs
- xchg esi,edi
+ xchg esi,edi ; Opposite direction of a Read!
call bcopy
xor ax,ax
ret
@@ -397,7 +402,8 @@ EDDGetParms:
ret
%endif ; EDD
- ; Set up registers as for a "Read", and compares against disk size.
+ ; Set up registers as for a "Read", and compares against disk
+ ; size.
; WARNING: This fails immediately, even if we can transfer some
; sectors. This isn't really the correct behaviour.
setup_regs:
@@ -589,21 +595,22 @@ Int15Start:
oldint15: pop bp
jmp far [cs:OldInt15]
-int15_e801:
+int15_e801: ; Get mem size for > 64 MB config
mov ax,[cs:Mem1MB]
mov cx,ax
mov bx,[cs:Mem16MB]
mov dx,bx
jmp short int15_success
-int15_e881:
+int15_e881: ; Get mem size for > 64 MB config
+ ; 32-bit code
mov eax,[cs:Mem1MB]
mov ecx,eax
mov ebx,[cs:Mem16MB]
mov edx,ebx
jmp short int15_success
-int15_88:
+int15_88: ; Get extended mem size
mov ax,[cs:MemInt1588]
jmp short int15_success
@@ -805,7 +812,8 @@ Int13Funcs dw Reset ; 00h - RESET
dw Invalid ; 06h - FORMAT TRACK AND SET BAD FLAGS
dw Invalid ; 07h - FORMAT DRIVE AT TRACK
dw GetParms ; 08h - GET PARAMETERS
- dw InitWithParms ; 09h - INITIALIZE CONTROLLER WITH DRIVE PARAMETERS
+ dw InitWithParms ; 09h - INITIALIZE CONTROLLER WITH
+ ; DRIVE PARAMETERS
dw Invalid ; 0Ah
dw Invalid ; 0Bh
dw Seek ; 0Ch - SEEK TO CYLINDER
diff --git a/memdisk/postprocess.pl b/memdisk/postprocess.pl
index f8cba963..fcda4782 100755
--- a/memdisk/postprocess.pl
+++ b/memdisk/postprocess.pl
@@ -12,8 +12,10 @@
## -----------------------------------------------------------------------
#
-# Postprocess the memdisk binary.
-#
+# Postprocess the memdisk binary. Used during the 'make' process.
+# We write memdisk16.bin out to the final memdisk kernel, pad it to an
+# integral 512-byte sector length, write this number of sectors into the
+# kernel header field "setup_sects", then append memdisk32.bin
eval { use bytes; };