summaryrefslogtreecommitdiff
path: root/core/ldlinux.asm
diff options
context:
space:
mode:
Diffstat (limited to 'core/ldlinux.asm')
-rw-r--r--core/ldlinux.asm54
1 files changed, 23 insertions, 31 deletions
diff --git a/core/ldlinux.asm b/core/ldlinux.asm
index ba7e8040..c08799f4 100644
--- a/core/ldlinux.asm
+++ b/core/ldlinux.asm
@@ -106,7 +106,7 @@ trackbufsize equ 8192
trackbuf resb trackbufsize ; Track buffer goes here
; ends at 2800h
- section .bss
+ section .bss16
alignb 4
FAT resd 1 ; Location of (first) FAT
RootDirArea resd 1 ; Location of root directory area
@@ -117,7 +117,6 @@ TotalSectors resd 1 ; Total number of sectors
ClustSize resd 1 ; Bytes/cluster
ClustMask resd 1 ; Sectors/cluster - 1
CopySuper resb 1 ; Distinguish .bs versus .bss
-DriveNumber resb 1 ; BIOS drive number
ClustShift resb 1 ; Shift count for sectors/cluster
ClustByteShift resb 1 ; Shift count for bytes/cluster
@@ -130,6 +129,12 @@ Files resb MAX_OPEN*open_file_t_size
%include "diskstart.inc"
;
+; Common initialization code
+;
+%include "init.inc"
+%include "cpuinit.inc"
+
+;
; Compute some information about this filesystem.
;
@@ -202,11 +207,6 @@ getfattype:
.setsize:
mov byte [nextcluster+1],cl
-;
-; Common initialization code
-;
-%include "cpuinit.inc"
-%include "init.inc"
;
; Initialize the metadata cache
@@ -218,7 +218,12 @@ getfattype:
; verbosity and using the full screen system
;
; E9 = JMP NEAR
- mov dword [kaboom.patch],0e9h+((kaboom2-(kaboom.patch+3)) << 8)
+ mov di,kaboom.patch
+ mov al,0e9h
+ stosb
+ mov ax,kaboom2-2
+ sub ax,di
+ stosw
;
; Now we're all set to start with our *real* business. First load the
@@ -553,7 +558,7 @@ search_dos_dir:
pop bx
ret
- section .data
+ section .data16
alignz 4
; Note: we have no use of the first 32 bytes (header),
; nor of the folloing 32 bytes (case mapping of control
@@ -565,7 +570,7 @@ cp_unicode equ codepage+cp.unicode
cp_unicode_alt equ codepage+cp.unicode_alt
codepage_end equ $
- section .text
+ section .text16
;
; Input: UCS-2 character in AX
; Output: Single byte character in AL, ZF = 1
@@ -587,12 +592,12 @@ ucs2_to_cp:
not ax ; Doesn't change the flags!
ret
- section .bss
+ section .bss16
VFATInit resb 1
VFATNext resb 1
VFATCsum resb 1
- section .text
+ section .text16
;
; close_file:
; Deallocates a file structure (pointer in SI)
@@ -946,12 +951,11 @@ readdir:
.end:
ret
- section .bss
+ section .bss16
alignb 4
-CurrentDir resd 1 ; Current directory
PrevDir resd 1 ; Last scanned directory
- section .text
+ section .text16
;
;
@@ -1100,13 +1104,13 @@ mangle_dos_name:
stosb ; Otherwise, write a space
loop .period_loop ; Dec CX and *always* jump
- section .bss
+ section .bss16
alignb 2
NameStart resw 1
NameLen resw 1
MangledBuf resb 11
- section .text
+ section .text16
;
; getfssec_edx: Get multiple sectors from a file
;
@@ -1360,30 +1364,18 @@ getfatsector:
; Common modules
; -----------------------------------------------------------------------------
-%include "getc.inc" ; getc et al
-%include "conio.inc" ; Console I/O
+%include "common.inc" ; Universal modules
%include "plaincon.inc" ; writechr
%include "writestr.inc" ; String output
%include "writehex.inc" ; Hexadecimal output
-%include "configinit.inc" ; Initialize configuration
-%include "parseconfig.inc" ; High-level config file handling
-%include "parsecmd.inc" ; Low-level config file handling
-%include "bcopy32.inc" ; 32-bit bcopy
-%include "loadhigh.inc" ; Load a file into high memory
-%include "font.inc" ; VGA font stuff
-%include "graphics.inc" ; VGA graphics
-%include "highmem.inc" ; High memory sizing
-%include "strcpy.inc" ; strcpy()
%include "cache.inc" ; Metadata disk cache
-%include "idle.inc" ; Idle handling
-%include "adv.inc" ; Auxillary Data Vector
%include "localboot.inc" ; Disk-based local boot
; -----------------------------------------------------------------------------
; Begin data section
; -----------------------------------------------------------------------------
- section .data
+ section .data16
copyright_str db ' Copyright (C) 1994-'
asciidec YEAR
db ' H. Peter Anvin et al', CR, LF, 0