mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-23 05:44:41 +02:00
patches from Arkady, Lucho, and Bart -- see history.txt for details
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1009 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
640ab403e2
commit
f4ab00c556
165
boot/boot.asm
165
boot/boot.asm
@ -91,50 +91,6 @@ Entry: jmp short real_start
|
|||||||
|
|
||||||
;%define StoreSI bp+3h ;temp store
|
;%define StoreSI bp+3h ;temp store
|
||||||
|
|
||||||
; To save space, functions that are just called once are
|
|
||||||
; implemented as macros instead. Four bytes are saved by
|
|
||||||
; avoiding the call / ret instructions.
|
|
||||||
|
|
||||||
|
|
||||||
; GETDRIVEPARMS: Calculate start of some disk areas.
|
|
||||||
;
|
|
||||||
|
|
||||||
%macro GETDRIVEPARMS 0
|
|
||||||
mov si, word [nHidden]
|
|
||||||
mov di, word [nHidden+2]
|
|
||||||
add si, word [bsResSectors]
|
|
||||||
adc di, byte 0 ; DI:SI = first FAT sector
|
|
||||||
|
|
||||||
mov word [fat_start], si
|
|
||||||
mov word [fat_start+2], di
|
|
||||||
|
|
||||||
mov al, [bsFATs]
|
|
||||||
cbw
|
|
||||||
mul word [sectPerFat] ; DX:AX = total number of FAT sectors
|
|
||||||
|
|
||||||
add si, ax
|
|
||||||
adc di, dx ; DI:SI = first root directory sector
|
|
||||||
mov word [root_dir_start], si
|
|
||||||
mov word [root_dir_start+2], di
|
|
||||||
|
|
||||||
; Calculate how many sectors the root directory occupies.
|
|
||||||
mov bx, [bsBytesPerSec]
|
|
||||||
mov cl, 5 ; divide BX by 32
|
|
||||||
shr bx, cl ; BX = directory entries per sector
|
|
||||||
|
|
||||||
mov ax, [bsRootDirEnts]
|
|
||||||
xor dx, dx
|
|
||||||
div bx
|
|
||||||
|
|
||||||
mov word [RootDirSecs], ax ; AX = sectors per root directory
|
|
||||||
|
|
||||||
add si, ax
|
|
||||||
adc di, byte 0 ; DI:SI = first data sector
|
|
||||||
|
|
||||||
mov [data_start], si
|
|
||||||
mov [data_start+2], di
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
;-----------------------------------------------------------------------
|
;-----------------------------------------------------------------------
|
||||||
|
|
||||||
times 0x3E-$+$$ db 0
|
times 0x3E-$+$$ db 0
|
||||||
@ -216,10 +172,42 @@ dont_use_dl: ; no, rely on [drive] written by SYS
|
|||||||
mov LBA_SIZE, 10h
|
mov LBA_SIZE, 10h
|
||||||
mov LBA_SECNUM,1 ; initialise LBA packet constants
|
mov LBA_SECNUM,1 ; initialise LBA packet constants
|
||||||
|
|
||||||
call print
|
|
||||||
db "FreeDOS",0
|
|
||||||
|
|
||||||
GETDRIVEPARMS
|
; GETDRIVEPARMS: Calculate start of some disk areas.
|
||||||
|
;
|
||||||
|
mov si, word [nHidden]
|
||||||
|
mov di, word [nHidden+2]
|
||||||
|
add si, word [bsResSectors]
|
||||||
|
adc di, byte 0 ; DI:SI = first FAT sector
|
||||||
|
|
||||||
|
mov word [fat_start], si
|
||||||
|
mov word [fat_start+2], di
|
||||||
|
|
||||||
|
mov al, [bsFATs]
|
||||||
|
cbw
|
||||||
|
mul word [sectPerFat] ; DX:AX = total number of FAT sectors
|
||||||
|
|
||||||
|
add si, ax
|
||||||
|
adc di, dx ; DI:SI = first root directory sector
|
||||||
|
mov word [root_dir_start], si
|
||||||
|
mov word [root_dir_start+2], di
|
||||||
|
|
||||||
|
; Calculate how many sectors the root directory occupies.
|
||||||
|
mov bx, [bsBytesPerSec]
|
||||||
|
mov cl, 5 ; divide BX by 32
|
||||||
|
shr bx, cl ; BX = directory entries per sector
|
||||||
|
|
||||||
|
mov ax, [bsRootDirEnts]
|
||||||
|
xor dx, dx
|
||||||
|
div bx
|
||||||
|
|
||||||
|
mov word [RootDirSecs], ax ; AX = sectors per root directory
|
||||||
|
|
||||||
|
add si, ax
|
||||||
|
adc di, byte 0 ; DI:SI = first data sector
|
||||||
|
|
||||||
|
mov [data_start], si
|
||||||
|
mov [data_start+2], di
|
||||||
|
|
||||||
|
|
||||||
; FINDFILE: Searches for the file in the root directory.
|
; FINDFILE: Searches for the file in the root directory.
|
||||||
@ -235,8 +223,6 @@ dont_use_dl: ; no, rely on [drive] written by SYS
|
|||||||
mov di, word [RootDirSecs]
|
mov di, word [RootDirSecs]
|
||||||
les bx, [loadsegoff_60] ; es:bx = 60:0
|
les bx, [loadsegoff_60] ; es:bx = 60:0
|
||||||
call readDisk
|
call readDisk
|
||||||
jc jmp_boot_error
|
|
||||||
|
|
||||||
les di, [loadsegoff_60] ; es:di = 60:0
|
les di, [loadsegoff_60] ; es:di = 60:0
|
||||||
|
|
||||||
|
|
||||||
@ -258,10 +244,6 @@ next_entry: mov cx, 11
|
|||||||
ffDone:
|
ffDone:
|
||||||
push ax ; store first cluster number
|
push ax ; store first cluster number
|
||||||
|
|
||||||
; call print
|
|
||||||
; db " FAT",0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; GETFATCHAIN:
|
; GETFATCHAIN:
|
||||||
;
|
;
|
||||||
@ -271,20 +253,16 @@ ffDone:
|
|||||||
;
|
;
|
||||||
; The file must fit in conventional memory, so it can't be larger than
|
; The file must fit in conventional memory, so it can't be larger than
|
||||||
; 640 kb. The sector size must be at least 512 bytes, so the FAT chain
|
; 640 kb. The sector size must be at least 512 bytes, so the FAT chain
|
||||||
; can't be larger than around 3 kb.
|
; can't be larger than 2.5 KB (655360 / 512 * 2 = 2560).
|
||||||
;
|
;
|
||||||
; Call with: AX = first cluster in chain
|
; Call with: AX = first cluster in chain
|
||||||
|
|
||||||
; Load the complete FAT into memory. The FAT can't be larger
|
|
||||||
; than 128 kb, so it should fit in the temporary buffer.
|
|
||||||
|
|
||||||
les bx, [loadsegoff_60] ; es:bx=60:0
|
les bx, [loadsegoff_60] ; es:bx=60:0
|
||||||
mov di, [sectPerFat]
|
mov di, [sectPerFat]
|
||||||
mov ax, word [fat_start]
|
mov ax, word [fat_start]
|
||||||
mov dx, word [fat_start+2]
|
mov dx, word [fat_start+2]
|
||||||
call readDisk
|
call readDisk
|
||||||
pop ax ; restore first cluster number
|
pop ax ; restore first cluster number
|
||||||
jmp_boot_error: jc boot_error
|
|
||||||
|
|
||||||
; Set ES:DI to the temporary storage for the FAT chain.
|
; Set ES:DI to the temporary storage for the FAT chain.
|
||||||
push ds
|
push ds
|
||||||
@ -342,9 +320,6 @@ finished: ; Mark end of FAT chain with 0, so we have a single
|
|||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
|
|
||||||
;call print
|
|
||||||
;db " Kernel",0 ; "KERNEL"
|
|
||||||
|
|
||||||
|
|
||||||
; loadFile: Loads the file into memory, one cluster at a time.
|
; loadFile: Loads the file into memory, one cluster at a time.
|
||||||
|
|
||||||
@ -353,10 +328,12 @@ finished: ; Mark end of FAT chain with 0, so we have a single
|
|||||||
mov si, FATBUF ; set DS:SI to the FAT chain
|
mov si, FATBUF ; set DS:SI to the FAT chain
|
||||||
|
|
||||||
cluster_next: lodsw ; AX = next cluster to read
|
cluster_next: lodsw ; AX = next cluster to read
|
||||||
or ax, ax ; if EOF...
|
or ax, ax ; EOF?
|
||||||
je boot_success ; ...boot was successful
|
jne load_next ; no, continue
|
||||||
|
mov bl,dl ; drive (left from readDisk)
|
||||||
|
jmp far [loadsegoff_60] ; yes, pass control to kernel
|
||||||
|
|
||||||
dec ax ; cluster numbers start with 2
|
load_next: dec ax ; cluster numbers start with 2
|
||||||
dec ax
|
dec ax
|
||||||
|
|
||||||
mov di, word [bsSecPerClust]
|
mov di, word [bsSecPerClust]
|
||||||
@ -365,35 +342,26 @@ cluster_next: lodsw ; AX = next cluster to read
|
|||||||
add ax, [data_start]
|
add ax, [data_start]
|
||||||
adc dx, [data_start+2] ; DX:AX = first sector to read
|
adc dx, [data_start+2] ; DX:AX = first sector to read
|
||||||
call readDisk
|
call readDisk
|
||||||
jnc cluster_next
|
jmp short cluster_next
|
||||||
|
|
||||||
|
; shows text after the call to this function.
|
||||||
|
|
||||||
boot_error: call print
|
show: pop si
|
||||||
db " err",0
|
lodsb ; get character
|
||||||
|
push si ; stack up potential return address
|
||||||
|
mov ah,0x0E ; show character
|
||||||
|
int 0x10 ; via "TTY" mode
|
||||||
|
cmp al,'.' ; end of string?
|
||||||
|
jne show ; until done
|
||||||
|
ret
|
||||||
|
|
||||||
xor ah,ah
|
boot_error: call show
|
||||||
int 0x16 ; wait for a key
|
db "Error! Hit a key to reboot."
|
||||||
int 0x19 ; reboot the machine
|
|
||||||
|
|
||||||
boot_success:
|
xor ah,ah
|
||||||
;call print
|
int 0x13 ; reset floppy
|
||||||
;db " GO! ",0
|
int 0x16 ; wait for a key
|
||||||
mov bl, [drive]
|
int 0x19 ; reboot the machine
|
||||||
jmp far [loadsegoff_60]
|
|
||||||
|
|
||||||
|
|
||||||
; prints text after call to this function.
|
|
||||||
|
|
||||||
print_1char:
|
|
||||||
xor bx, bx ; video page 0
|
|
||||||
mov ah, 0x0E ; else print it
|
|
||||||
int 0x10 ; via TTY mode
|
|
||||||
print: pop si ; this is the first character
|
|
||||||
print1: lodsb ; get token
|
|
||||||
push si ; stack up potential return address
|
|
||||||
cmp al, 0 ; end of string?
|
|
||||||
jne print_1char ; until done
|
|
||||||
ret ; and jump to it
|
|
||||||
|
|
||||||
|
|
||||||
; readDisk: Reads a number of sectors into memory.
|
; readDisk: Reads a number of sectors into memory.
|
||||||
@ -401,7 +369,6 @@ print1: lodsb ; get token
|
|||||||
; Call with: DX:AX = 32-bit DOS sector number
|
; Call with: DX:AX = 32-bit DOS sector number
|
||||||
; DI = number of sectors to read
|
; DI = number of sectors to read
|
||||||
; ES:BX = destination buffer
|
; ES:BX = destination buffer
|
||||||
; ES must be 64k aligned (1000h, 2000h etc).
|
|
||||||
;
|
;
|
||||||
; Returns: CF set on error
|
; Returns: CF set on error
|
||||||
; ES:BX points one byte after the last byte read.
|
; ES:BX points one byte after the last byte read.
|
||||||
@ -413,6 +380,8 @@ readDisk: push si
|
|||||||
mov word [LBA_SEG],es
|
mov word [LBA_SEG],es
|
||||||
mov word [LBA_OFF],bx
|
mov word [LBA_OFF],bx
|
||||||
|
|
||||||
|
call show
|
||||||
|
db "."
|
||||||
read_next:
|
read_next:
|
||||||
|
|
||||||
;******************** LBA_READ *******************************
|
;******************** LBA_READ *******************************
|
||||||
@ -487,25 +456,15 @@ read_normal_BIOS:
|
|||||||
xchg ch, cl ; set cyl no low 8 bits
|
xchg ch, cl ; set cyl no low 8 bits
|
||||||
ror cl, 1 ; move track high bits into
|
ror cl, 1 ; move track high bits into
|
||||||
ror cl, 1 ; bits 7-6 (assumes top = 0)
|
ror cl, 1 ; bits 7-6 (assumes top = 0)
|
||||||
mov al, byte [sectPerTrack]
|
|
||||||
sub al, ah ; al has # of sectors left
|
|
||||||
inc ah ; sector offset from 1
|
|
||||||
or cl, ah ; merge sector into cylinder
|
or cl, ah ; merge sector into cylinder
|
||||||
|
inc cx ; make sector 1-based (1-63)
|
||||||
|
|
||||||
les bx,[LBA_OFF]
|
les bx,[LBA_OFF]
|
||||||
mov ax, 0x0201
|
mov ax, 0x0201
|
||||||
do_int13_read:
|
do_int13_read:
|
||||||
mov dl, [drive]
|
mov dl, [drive]
|
||||||
int 0x13
|
int 0x13
|
||||||
|
jc boot_error ; exit on error
|
||||||
read_finished:
|
|
||||||
jnc read_ok ; jump if no error
|
|
||||||
xor ah, ah ; else, reset floppy
|
|
||||||
int 0x13
|
|
||||||
read_next_chained:
|
|
||||||
jmp short read_next ; read the same sector again
|
|
||||||
|
|
||||||
read_ok:
|
|
||||||
mov ax, word [bsBytesPerSec]
|
mov ax, word [bsBytesPerSec]
|
||||||
div byte[LBA_PACKET] ; luckily 16 !!
|
div byte[LBA_PACKET] ; luckily 16 !!
|
||||||
add word [LBA_SEG], ax
|
add word [LBA_SEG], ax
|
||||||
@ -513,7 +472,7 @@ read_ok:
|
|||||||
add LBA_SECTOR_0, byte 1
|
add LBA_SECTOR_0, byte 1
|
||||||
adc LBA_SECTOR_16, byte 0 ; DX:AX = next sector to read
|
adc LBA_SECTOR_16, byte 0 ; DX:AX = next sector to read
|
||||||
dec di ; if there is anything left to read,
|
dec di ; if there is anything left to read,
|
||||||
jnz read_next_chained ; continue
|
jnz read_next ; continue
|
||||||
|
|
||||||
mov es,word [LBA_SEG]
|
mov es,word [LBA_SEG]
|
||||||
; clear carry: unnecessary since adc clears it
|
; clear carry: unnecessary since adc clears it
|
||||||
|
12
build.bat
12
build.bat
@ -4,7 +4,7 @@
|
|||||||
:- $Id$
|
:- $Id$
|
||||||
|
|
||||||
:-----------------------------------------------------------------------
|
:-----------------------------------------------------------------------
|
||||||
:- Syntax: BUILD [-r] [fat32|fat16] [msc|wc|tc|tcpp] [86|186|386]
|
:- Syntax: BUILD [-r] [fat32|fat16] [msc|wc|tc|tcpp] [86|186|386] [debug] [lfnapi]
|
||||||
:- option case is significant !!
|
:- option case is significant !!
|
||||||
:-----------------------------------------------------------------------
|
:-----------------------------------------------------------------------
|
||||||
|
|
||||||
@ -39,6 +39,9 @@ if "%1" == "86" set XCPU=86
|
|||||||
if "%1" == "186" set XCPU=186
|
if "%1" == "186" set XCPU=186
|
||||||
if "%1" == "386" set XCPU=386
|
if "%1" == "386" set XCPU=386
|
||||||
|
|
||||||
|
if "%1" == "debug" set ALLCFLAGS=%ALLCFLAGS% -DDEBUG
|
||||||
|
if "%1" == "lfnapi" set ALLCFLAGS=%ALLCFLAGS% -DWITHLFNAPI
|
||||||
|
|
||||||
shift
|
shift
|
||||||
if not "%1" == "" goto loop_commandline
|
if not "%1" == "" goto loop_commandline
|
||||||
|
|
||||||
@ -108,10 +111,13 @@ goto end
|
|||||||
|
|
||||||
:-----------------------------------------------------------------------
|
:-----------------------------------------------------------------------
|
||||||
|
|
||||||
:abort-cd
|
|
||||||
cd ..
|
|
||||||
:noenv
|
:noenv
|
||||||
echo Unable to set necessary environment variables!
|
echo Unable to set necessary environment variables!
|
||||||
|
goto abort
|
||||||
|
|
||||||
|
:abort-cd
|
||||||
|
cd ..
|
||||||
|
|
||||||
:abort
|
:abort
|
||||||
echo Compilation was aborted!
|
echo Compilation was aborted!
|
||||||
|
|
||||||
|
1
config.b
1
config.b
@ -109,6 +109,7 @@ set XUPX=upx --8086 --best
|
|||||||
:-----------------------------------------------------------------------
|
:-----------------------------------------------------------------------
|
||||||
:- select default target: CPU type (default is 86) and
|
:- select default target: CPU type (default is 86) and
|
||||||
:- what FAT system (default is 32) to support
|
:- what FAT system (default is 32) to support
|
||||||
|
:- NOTE: Turbo C doesn't support 386 CPU.
|
||||||
|
|
||||||
::set XCPU=86
|
::set XCPU=86
|
||||||
::set XCPU=186
|
::set XCPU=186
|
||||||
|
@ -80,6 +80,7 @@ set MAKE=
|
|||||||
set XUPX=
|
set XUPX=
|
||||||
set XCPU=
|
set XCPU=
|
||||||
set XFAT=
|
set XFAT=
|
||||||
|
set ALLCFLAGS=
|
||||||
|
|
||||||
if not "%OLDPATH%" == "" set PATH=%OLDPATH%
|
if not "%OLDPATH%" == "" set PATH=%OLDPATH%
|
||||||
set OLDPATH=
|
set OLDPATH=
|
||||||
|
236
docs/config.txt
236
docs/config.txt
@ -1,51 +1,220 @@
|
|||||||
Advanced - FreeDOS specific - CONFIG.SYS processing
|
Configuring your DOS system for use:
|
||||||
|
------------------------------------
|
||||||
a new command DOSDATA=UMB
|
When booting DOS, you will find it only supports a subset of
|
||||||
DOSDATA=UMB loads some FreeDOS specific stuff in Upper Memory Blocks,
|
the devices available on many computers. To support additional
|
||||||
like the RAM that FILESHIGH, LASTDRIVEHIGH, and STACKSHIGH occupy
|
devices and advanced features, device specific driver and
|
||||||
|
memory resident software most be loaded. This allows the
|
||||||
a new command ECHO
|
kernel to be easily extended to support hardware not presently
|
||||||
ECHO does ECHO its argument (surprised ?-) and is executed at
|
available and take better advantage of installed hardware
|
||||||
the time the DEVICE= lines are executed.
|
without wasting resources on computers lacking it. This
|
||||||
use it similarly to
|
software is generally loaded during the kernel initialization
|
||||||
|
phase, with details describing what to load expressed in the
|
||||||
ECHO loading driver 1
|
file CONFIG.SYS. The FreeDOS kernel will first look for a
|
||||||
device=Driver1.sys
|
file named FDCONFIG.SYS, should it exist, it will will be used
|
||||||
ECHO driver1 successfully loaded
|
instead of CONFIG.SYS; this allows the FreeDOS kernel to coexist
|
||||||
|
and be configured differently than another DOS kernel. There
|
||||||
a new command called EECHO is also available, for echo-ing ANSI Escape Sequences
|
are additional options available to adjust other aspects of the
|
||||||
(redefines keyboard input for example).
|
kernels behaviour. Note: some options listed below are FreeDOS
|
||||||
|
specific and will not work when using other/older DOS kernels.
|
||||||
|
Below is list of all documented FreeDOS config.sys supported
|
||||||
|
options; additional undocumented options may exist but are not
|
||||||
|
meant for normal usage.
|
||||||
|
|
||||||
|
|
||||||
an undocumented command SCREEN=xx
|
BREAK
|
||||||
SCREEN= switches into videomode xxx (INT10/11xx/000)
|
Usage: break=on|off
|
||||||
useful
|
Set extended Control-C/Control-Break checking to on [default] or off.
|
||||||
SCREEN=0x11 -- 28 lines
|
When set to on, the kernel will perform the check (and invoke current
|
||||||
SCREEN=0x12 -- 43/50 lines (on EGA/VGA)
|
handler if pressed) prior to most int 21h calls. When set to off,
|
||||||
|
the kernel only performs the check on I/O calls using standard streams.
|
||||||
|
e.g. break=off
|
||||||
|
|
||||||
|
BUFFERS
|
||||||
|
BUFFERSHIGH
|
||||||
|
Usage: buffers=nn[,n] where nn is in range 1-99 & n is in range 1-8
|
||||||
|
Memory buffers used by the kernel; primary[,secondary]
|
||||||
|
The secondary buffer option is available for compatibility with
|
||||||
|
other DOS kernels, but is ignored by the FreeDOS kernel.
|
||||||
|
e.g. buffers=20
|
||||||
|
|
||||||
|
COUNTRY
|
||||||
|
Usage: country=nnn[,[mmm][,[d:][path]file]]
|
||||||
|
Only limited country=nnn support is presently available.
|
||||||
|
Enables/sets international features of DOS
|
||||||
|
nnn is country code (001==US)
|
||||||
|
mmm is code page (437 is default, 850 is updated form, 1252 for Windows)
|
||||||
|
[drive][path]file specifies file with country specific data
|
||||||
|
e.g. country=001,850,C:\FDOS\BIN\COUNTRY.SYS
|
||||||
|
|
||||||
|
DEVICE
|
||||||
|
Usage: device=[d:][path]file [options]
|
||||||
|
Load the device driver specified by d:path\file (into conventional
|
||||||
|
[low 640KB] memory). The options are for the driver itself; refer
|
||||||
|
to documentation that came with your particular device for supported
|
||||||
|
options and their usage.
|
||||||
|
e.g. device=himem.sys
|
||||||
|
|
||||||
|
DEVICEHIGH
|
||||||
|
Usage: devicehigh=[d:][path]file [options]
|
||||||
|
This is just like device= statement, except it attempts to load
|
||||||
|
the device driver into high memory first (failing that it should
|
||||||
|
load it in conventional memory).
|
||||||
|
Note: The order you load devices may have a large impact on amount
|
||||||
|
of free memory available. In general try to load large (in memory
|
||||||
|
usage) programs into high memory first.
|
||||||
|
Important: You should have a high memory manager such as FDXMS or
|
||||||
|
Himem installed (prior device=FDXMS.SYS or device=HIMEM.SYS) before
|
||||||
|
using this option.
|
||||||
|
e.g. devicehigh=atapicdd.sys /D:FDCD0001
|
||||||
|
|
||||||
|
DOS
|
||||||
|
Usage: dos=high|low,umb|noumb
|
||||||
|
Indicates whether the kernel should try to load itself into
|
||||||
|
high memory or only conventional (low), and whether to link
|
||||||
|
upper memory blocks in with normal memory or not.
|
||||||
|
Note: only one set need be given, ie dos=high and dos=noumb are ok.
|
||||||
|
Important: if you specify dos=high[,umb|noumb] then you must also
|
||||||
|
load a high memory manager (first), ie FDXMS or HIMEM
|
||||||
|
e.g. dos=high,umb
|
||||||
|
or dos=low,noumb
|
||||||
|
|
||||||
|
DOSDATA
|
||||||
|
Usage: dosdata=umb
|
||||||
|
Try to load kernel data into Upper Memory Blocks; effectively
|
||||||
|
same as using the <name>HIGH variant of kernel parameters,
|
||||||
|
such as fileshigh, lastdrivehigh, and stackshigh (does not
|
||||||
|
effect drivers loaded using device= or install=).
|
||||||
|
e.g. dosdata=umb
|
||||||
|
|
||||||
|
ECHO
|
||||||
|
Usage: ECHO Message to be displayed to user.
|
||||||
|
ECHO displays (echos) its arguments to the console during
|
||||||
|
config.sys processing when device drivers are loaded (when
|
||||||
|
DEVICE= lines are executed).
|
||||||
|
e.g.
|
||||||
|
ECHO loading driver 1
|
||||||
|
device=Driver1.sys
|
||||||
|
ECHO driver1 successfully loaded
|
||||||
|
|
||||||
|
EECHO
|
||||||
|
Usage: EECHO Message with ANSI Escape Sequence
|
||||||
|
EECHO allows for echo-ing ANSI Escape Sequences
|
||||||
|
(redefines keyboard input for example). Use a dollar sign ($)
|
||||||
|
to represent the ANSI Escape character. Note: requires an
|
||||||
|
ansi driver loaded prior to use.
|
||||||
|
|
||||||
|
FCBS
|
||||||
|
Usage: fcbs=nnn
|
||||||
|
where nnn is in range 1-255
|
||||||
|
Sets the number of File Control Blocks to reserve room for.
|
||||||
|
As file control blocks have been replaced by file handles
|
||||||
|
(see files) most applications will not need this value adjusted.
|
||||||
|
e.g. fcbs=4
|
||||||
|
|
||||||
|
FILES
|
||||||
|
FILESHIGH
|
||||||
|
Usage: files=nnn
|
||||||
|
where nnn is in range 8-255 (default 8)
|
||||||
|
Specifies how many files allowed open at once (reserves
|
||||||
|
memory necessary to support opening this many files).
|
||||||
|
Note: there are other restrictions, so a given program
|
||||||
|
may not be able to actually open this many
|
||||||
|
A good number is 20, though some programs suggest/require
|
||||||
|
30, 40, or even 255
|
||||||
|
e.g. files=20
|
||||||
|
|
||||||
|
INSTALL
|
||||||
|
INSTALLHIGH
|
||||||
|
Usage: install=[d:][path]file [options]
|
||||||
|
Load the program specified by d:path\file. Generally used to
|
||||||
|
load TSR (terminate and stay resident) programs with a minimal
|
||||||
|
environment block. The options are for the program itself; refer
|
||||||
|
to documentation that came with your particular software for
|
||||||
|
supported options and usage.
|
||||||
|
e.g. install=nansi.com
|
||||||
|
|
||||||
|
LASTDRIVE
|
||||||
|
LASTDRIVEHIGH
|
||||||
|
Usage: lastdrive=x
|
||||||
|
where x is last drive letter available for use; A-Z
|
||||||
|
e.g. lastdrive=z
|
||||||
|
|
||||||
|
NUMLOCK
|
||||||
|
Usage: numlock=on|off
|
||||||
|
Set the keyboard number lock to on or off.
|
||||||
|
e.g. numlock=off
|
||||||
|
|
||||||
|
REM
|
||||||
|
Usage: rem Your remarks!
|
||||||
|
This provides the ability to place comments within the configuration
|
||||||
|
file. The text following the rem until the end of the line is
|
||||||
|
reached are ignored. This may also be used to temporarily disable
|
||||||
|
loading a particular device or other option.
|
||||||
|
|
||||||
|
SCREEN
|
||||||
|
Usage: screen=xx
|
||||||
|
Switches into videomode xxx (INT10/11xx/000)
|
||||||
|
where xx should be 0x11 for 28 lines or 0x12 for 43/50 (EGA/VGA) lines
|
||||||
|
|
||||||
|
SET
|
||||||
|
Usage: set ENVVAR=value
|
||||||
|
Sets the environment variable to provided value.
|
||||||
|
e.g. set HOME=C:\home\me
|
||||||
|
|
||||||
|
SHELL
|
||||||
|
SHELLHIGH
|
||||||
|
Usage: shell=[d:][path]file [options]
|
||||||
|
Indicates the shell to use; often used to alter COMMAND.COM's behavior.
|
||||||
|
Note: it is command.com that processes AUTOEXEC.BAT; by using the
|
||||||
|
shell option, you can get command.com to process a differently named
|
||||||
|
file (such as FDAUTO.BAT for coexisting with another DOS using different
|
||||||
|
configuration options) or run a completely different command interpreter
|
||||||
|
such as 4DOS or a (unix) sh variant.
|
||||||
|
e.g. shell=C:\COMMAND.COM /E:256 /P
|
||||||
|
|
||||||
|
STACKS
|
||||||
|
STACKSHIGH
|
||||||
|
Usage: stacks=nn,nnn
|
||||||
|
where nn is in range 0,8-64 and nnn is in range 32-512
|
||||||
|
Changes number of stacks available
|
||||||
|
nn is number of different stacks and nnn is size in bytes of each one
|
||||||
|
e.g. stacks=16,256
|
||||||
|
|
||||||
|
SWITCHAR
|
||||||
|
Usage: switchar=c
|
||||||
|
Sets the default switchar to character c. Where c is a single character
|
||||||
|
that is used to indicate a command line parameter is an option switch.
|
||||||
|
The default is a forward slash (/). Note: This simply sets the value
|
||||||
|
returned by a get switchar query, it will not effect programs that use
|
||||||
|
hardcoded switch characters.
|
||||||
|
e.g. switchar=-
|
||||||
|
|
||||||
|
VERSION
|
||||||
|
Usage: version=x.y
|
||||||
|
FreeDOS specific command to specify what DOS version to report.
|
||||||
|
e.g. version=6.2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
the following advanced config.sys processing options are available:
|
Advanced - FreeDOS specific CONFIG.SYS menu processing:
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
normal
|
normal
|
||||||
FILES=20
|
FILES=20
|
||||||
DEVICE=MyNetWorkDriver.sys
|
DEVICE=MyNetWorkDriver.sys
|
||||||
|
|
||||||
'?' - ALWAYS ask if a single line shall be executed
|
'?' - ALWAYS ask if a single line shall be executed
|
||||||
|
|
||||||
FILES=20
|
FILES=20
|
||||||
?DEVICE=MyNetWorkDriver.sys
|
?DEVICE=MyNetWorkDriver.sys
|
||||||
|
|
||||||
|
|
||||||
'!' - NEVER ask if a single line shall be executed, even if single stepping
|
'!' - NEVER ask if a single line shall be executed, even if single stepping
|
||||||
|
|
||||||
!FILES=20
|
!FILES=20
|
||||||
!DOS=HIGH,UMB
|
!DOS=HIGH,UMB
|
||||||
!BUFFERS=30
|
!BUFFERS=30
|
||||||
DEVICE=MyNetWorkDriver.sys
|
DEVICE=MyNetWorkDriver.sys
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
configuration management - you may compose several configurations,
|
configuration management - you may compose several configurations,
|
||||||
using following special commands:
|
using following special commands:
|
||||||
|
|
||||||
@ -66,8 +235,11 @@ MENUDEFAULT=0,1 ( configuration 0, wait 1 second)
|
|||||||
2? device=MyNetworkDriver.SYS
|
2? device=MyNetworkDriver.SYS
|
||||||
|
|
||||||
|
|
||||||
Although this is definitively worse then MSDOS menuing possibilities,
|
Although this is different than MSDOS menuing possibilities, it
|
||||||
IMHO it's better then nothing.
|
allows for selecting from multiple options during bootup while
|
||||||
|
remaining simple. It, however, does not allow for multi-level
|
||||||
|
menuing based configuration schemes.
|
||||||
|
|
||||||
|
|
||||||
It's also possible to combine menu options, to avoid writing thing every
|
It's also possible to combine menu options, to avoid writing thing every
|
||||||
time again.
|
time again.
|
||||||
@ -165,11 +337,7 @@ MENUDEFAULT=1,10 ( configuration 1, wait 10 seconds)
|
|||||||
4? ECHO You selected menu #4
|
4? ECHO You selected menu #4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2002-11-28 - Tom Ehlert
|
2002-11-28 - Tom Ehlert
|
||||||
2003-07-15 - Bernd Blaauw
|
2003-07-15 - Bernd Blaauw
|
||||||
2003-09-18 - Bart Oldeman
|
2003-09-18 - Bart Oldeman
|
||||||
|
2004-07-24 - Jeremy Davis
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
These are the known contributors of the FreeDOS kernel. If you have
|
These are the known contributors of the FreeDOS kernel. If you have
|
||||||
contributed in any way to the kernel, but are not on this list,
|
contributed in any way to the kernel, but are not on this list,
|
||||||
please email me at bart@dosemu.org so I can add you to the list!
|
please email the current kernel maintainer so we can add you to the list!
|
||||||
|
|
||||||
Thanks to all the following for contributing to the FreeDOS kernel:
|
Thanks to all the following for contributing to the FreeDOS kernel:
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2004 July 8 - UNSTABLE branch
|
2004 July 8 - UNSTABLE branch
|
||||||
-------- Jeremy Davis (jeremyd@computer.org)
|
-------- Jeremy Davis (jeremyd@computer.org)
|
||||||
|
+ Changes Bart
|
||||||
|
* int2f.asm
|
||||||
|
- bugfix: call_nls: DI register was not preserved
|
||||||
+ Changes Tom
|
+ Changes Tom
|
||||||
* inthndlr.c
|
* inthndlr.c
|
||||||
- improve handling of case where eg. FindFirst(I:\*.*) fails, causes Int24,
|
- improve handling of case where eg. FindFirst(I:\*.*) fails, causes Int24,
|
||||||
@ -264,6 +267,16 @@
|
|||||||
bytes, because Shell=SecPathName+50 and sizeof SecPathName=128).
|
bytes, because Shell=SecPathName+50 and sizeof SecPathName=128).
|
||||||
- P_0(): now supported command line without space between command and
|
- P_0(): now supported command line without space between command and
|
||||||
options (starting from '/').
|
options (starting from '/').
|
||||||
|
* dosfns.c
|
||||||
|
- common code from DosFindFirst() and DosFindNext() moved to pop_dmp()
|
||||||
|
- optimization for SftSeek()
|
||||||
|
* ludivmul.inc
|
||||||
|
- bugfix: division of long numbers in LDIVMODU macro (used for Watcom)
|
||||||
|
was wrong. Example: 100000h%8000Fh was gives 0FFFF1h instead 7_FFF1h.
|
||||||
|
- shorter code.
|
||||||
|
* inthndlr.c
|
||||||
|
- fix: INT21/3301 now returns in DL low bit of input value (as in MS-DOS).
|
||||||
|
- callerARG1 declared as xreg instead UWORD.
|
||||||
+ Changes Bernd, Aitor, & Arkady
|
+ Changes Bernd, Aitor, & Arkady
|
||||||
* config.c
|
* config.c
|
||||||
- source: (Bernd) the codepage table rewritten into a smaller layout.
|
- source: (Bernd) the codepage table rewritten into a smaller layout.
|
||||||
@ -276,6 +289,19 @@
|
|||||||
- fix: for MSVC CONST segment should be class CONST, not DATA.
|
- fix: for MSVC CONST segment should be class CONST, not DATA.
|
||||||
* dsk.c
|
* dsk.c
|
||||||
- play_dj() now says same words as MS-DOS6.
|
- play_dj() now says same words as MS-DOS6.
|
||||||
|
* boot.asm
|
||||||
|
- optimize and make more user friendly instead of retrying endlessly
|
||||||
|
* sys.c
|
||||||
|
- change OEM Name field to FRDOS4.1 per Eric Auer for better compatibility.
|
||||||
|
* ludivmul.inc
|
||||||
|
- 32-bit division code for 386-enabled Watcom kernel.
|
||||||
|
* inthndlr.c
|
||||||
|
- fix: for INT21/5F07 and 5F08, before changing bit CDSPHYSDRV,
|
||||||
|
MS-DOS checks if physical device associated with drive letter. Without
|
||||||
|
this check MS-FORMAT under FreeDOS was destroys RAMDISK.
|
||||||
|
+ Changes Jeremy
|
||||||
|
* config.txt
|
||||||
|
- update to include all CONFIG.SYS options (except ANYDOS)
|
||||||
*** Sync - Stable Build 2035 ***
|
*** Sync - Stable Build 2035 ***
|
||||||
|
|
||||||
2004 May 30 - Build 2035
|
2004 May 30 - Build 2035
|
||||||
|
@ -17,7 +17,7 @@ all: ..\lib\device.lib
|
|||||||
-$(RM) $*.lib
|
-$(RM) $*.lib
|
||||||
$(LIBUTIL) $(LIBFLAGS) $* $(LIBOBJS) $(LIBTERM)
|
$(LIBUTIL) $(LIBFLAGS) $* $(LIBOBJS) $(LIBTERM)
|
||||||
|
|
||||||
$(OBJS): $(DEPENDS)
|
$(OBJS): $(DEPENDS) ../kernel/segs.inc
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
|
2
filelist
2
filelist
@ -146,6 +146,7 @@
|
|||||||
*/*/sys/makefile
|
*/*/sys/makefile
|
||||||
*/*/sys/sys.c
|
*/*/sys/sys.c
|
||||||
*/*/sys/talloc.c
|
*/*/sys/talloc.c
|
||||||
|
*/*/sys/turboc.cfg
|
||||||
*/*/utils/echoto.bat
|
*/*/utils/echoto.bat
|
||||||
*/*/utils/exeflat.c
|
*/*/utils/exeflat.c
|
||||||
*/*/utils/makefile
|
*/*/utils/makefile
|
||||||
@ -153,3 +154,4 @@
|
|||||||
*/*/utils/relocinf.c
|
*/*/utils/relocinf.c
|
||||||
*/*/utils/rmfiles.bat
|
*/*/utils/rmfiles.bat
|
||||||
*/*/utils/wlinker.bat
|
*/*/utils/wlinker.bat
|
||||||
|
*/*/utils/turboc.cfg
|
||||||
|
@ -80,8 +80,8 @@ struct dpb {
|
|||||||
ULONG dpb_xdata;
|
ULONG dpb_xdata;
|
||||||
ULONG dpb_xsize; /* # of clusters+1 on media */
|
ULONG dpb_xsize; /* # of clusters+1 on media */
|
||||||
ULONG dpb_xfatsize; /* # of sectors / FAT */
|
ULONG dpb_xfatsize; /* # of sectors / FAT */
|
||||||
ULONG dpb_xrootclst; /* starting cluster of root dir */
|
CLUSTER dpb_xrootclst; /* starting cluster of root dir */
|
||||||
ULONG dpb_xcluster; /* cluster # of first free */
|
CLUSTER dpb_xcluster; /* cluster # of first free */
|
||||||
/* -1 if not known */
|
/* -1 if not known */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -89,4 +89,3 @@ struct dpb {
|
|||||||
#define UNKNCLUSTER 0x0000 /* see RBIL INT 21/AH=52 entry */
|
#define UNKNCLUSTER 0x0000 /* see RBIL INT 21/AH=52 entry */
|
||||||
#define XUNKNCLSTFREE 0xffffffffl /* unknown for DOS */
|
#define XUNKNCLSTFREE 0xffffffffl /* unknown for DOS */
|
||||||
#define UNKNCLSTFREE 0xffff /* unknown for DOS */
|
#define UNKNCLSTFREE 0xffff /* unknown for DOS */
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ typedef struct {
|
|||||||
/* bits 6-4: reserved (0) */
|
/* bits 6-4: reserved (0) */
|
||||||
/* bits 3-0: active FAT number */
|
/* bits 3-0: active FAT number */
|
||||||
UWORD bpb_xfsversion; /* filesystem version */
|
UWORD bpb_xfsversion; /* filesystem version */
|
||||||
ULONG bpb_xrootclst; /* starting cluster of root dir */
|
CLUSTER bpb_xrootclst; /* starting cluster of root dir */
|
||||||
UWORD bpb_xfsinfosec; /* FS info sector number, */
|
UWORD bpb_xfsinfosec; /* FS info sector number, */
|
||||||
/* 0xFFFF if unknown */
|
/* 0xFFFF if unknown */
|
||||||
UWORD bpb_xbackupsec; /* backup boot sector number */
|
UWORD bpb_xbackupsec; /* backup boot sector number */
|
||||||
|
@ -38,32 +38,25 @@ static BYTE *dirmatch_hRcsId =
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
UBYTE dm_drive;
|
UBYTE dm_drive;
|
||||||
BYTE dm_name_pat[FNAME_SIZE + FEXT_SIZE];
|
BYTE dm_name_pat[FNAME_SIZE + FEXT_SIZE];
|
||||||
BYTE dm_attr_srch;
|
BYTE dm_attr_srch; /* !!! should be UBYTE --avb */
|
||||||
UWORD dm_entry;
|
UWORD dm_entry;
|
||||||
#ifdef WITHFAT32
|
CLUSTER dm_dircluster;
|
||||||
ULONG dm_dircluster;
|
#ifndef WITHFAT32
|
||||||
#else
|
|
||||||
UWORD dm_dircluster;
|
|
||||||
UWORD reserved;
|
UWORD reserved;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
BITS /* directory has been modified */
|
BITS f_dmod:1; /* directory has been modified */
|
||||||
f_dmod:1;
|
BITS f_droot:1; /* directory is the root */
|
||||||
BITS /* directory is the root */
|
BITS f_dnew:1; /* fnode is new and needs fill */
|
||||||
f_droot:1;
|
BITS f_ddir:1; /* fnode is assigned to dir */
|
||||||
BITS /* fnode is new and needs fill */
|
BITS f_filler:12; /* filler to avoid a bad bug */
|
||||||
f_dnew:1;
|
/* (feature?) in TC 2.01 */
|
||||||
BITS /* fnode is assigned to dir */
|
|
||||||
f_ddir:1;
|
|
||||||
BITS /* filler to avoid a bad bug (feature?) in */
|
|
||||||
f_filler:12; /* TC 2.01 */
|
|
||||||
} dm_flags; /* file flags */
|
} dm_flags; /* file flags */
|
||||||
|
|
||||||
BYTE dm_attr_fnd; /* found file attribute */
|
UBYTE dm_attr_fnd; /* found file attribute */
|
||||||
time dm_time; /* file time */
|
time dm_time; /* file time */
|
||||||
date dm_date; /* file date */
|
date dm_date; /* file date */
|
||||||
LONG dm_size; /* file size */
|
ULONG dm_size; /* file size */
|
||||||
BYTE dm_name[FNAME_SIZE + FEXT_SIZE + 2]; /* file name */
|
BYTE dm_name[FNAME_SIZE + FEXT_SIZE + 2]; /* file name */
|
||||||
} dmatch;
|
} dmatch;
|
||||||
|
|
||||||
|
112
kernel/dosfns.c
112
kernel/dosfns.c
@ -308,22 +308,27 @@ long DosRWSft(int sft_idx, size_t n, void FAR * bp, int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
COUNT SftSeek(int sft_idx, LONG new_pos, COUNT mode)
|
COUNT SftSeek(int sft_idx, LONG new_pos, unsigned mode)
|
||||||
{
|
{
|
||||||
sft FAR *s = idx_to_sft(sft_idx);
|
sft FAR *s = idx_to_sft(sft_idx);
|
||||||
if (FP_OFF(s) == (size_t) -1)
|
if (FP_OFF(s) == (size_t) -1)
|
||||||
return DE_INVLDHNDL;
|
return DE_INVLDHNDL;
|
||||||
|
|
||||||
/* Test for invalid mode */
|
/* Test for invalid mode */
|
||||||
if (mode < 0 || mode > 2)
|
if (mode > SEEK_END) /* 2 */
|
||||||
return DE_INVLDFUNC;
|
return DE_INVLDFUNC;
|
||||||
|
|
||||||
lpCurSft = s;
|
lpCurSft = s;
|
||||||
|
|
||||||
if (s->sft_flags & SFT_FSHARED)
|
if (s->sft_flags & SFT_FSHARED)
|
||||||
{
|
{
|
||||||
|
/* SEEK_SET handled below (s->sft_posit=new_pos) */
|
||||||
|
if (mode == SEEK_CUR)
|
||||||
|
{
|
||||||
|
new_pos += s->sft_posit;
|
||||||
|
}
|
||||||
/* seek from end of file */
|
/* seek from end of file */
|
||||||
if (mode == 2)
|
else if (mode == SEEK_END)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* RB list has it as Note:
|
* RB list has it as Note:
|
||||||
@ -336,41 +341,24 @@ COUNT SftSeek(int sft_idx, LONG new_pos, COUNT mode)
|
|||||||
* Mfs.c looks for these mode bits set, so here is my best guess.;^)
|
* Mfs.c looks for these mode bits set, so here is my best guess.;^)
|
||||||
*/
|
*/
|
||||||
if (s->sft_mode & (O_DENYREAD | O_DENYNONE))
|
if (s->sft_mode & (O_DENYREAD | O_DENYNONE))
|
||||||
s->sft_posit = remote_lseek(s, new_pos);
|
new_pos = remote_lseek(s, new_pos);
|
||||||
else
|
else
|
||||||
s->sft_posit = s->sft_size + new_pos;
|
new_pos += s->sft_size;
|
||||||
return SUCCESS;
|
|
||||||
}
|
}
|
||||||
if (mode == 0)
|
|
||||||
{
|
|
||||||
s->sft_posit = new_pos;
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
if (mode == 1)
|
|
||||||
{
|
|
||||||
s->sft_posit += new_pos;
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
return DE_INVLDFUNC;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do special return for character devices */
|
/* Do special return for character devices */
|
||||||
if (s->sft_flags & SFT_FDEVICE)
|
else if (s->sft_flags & SFT_FDEVICE)
|
||||||
{
|
{
|
||||||
s->sft_posit = 0l;
|
new_pos = 0;
|
||||||
return SUCCESS;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LONG result = dos_lseek(s->sft_status, new_pos, mode);
|
if ((new_pos = dos_lseek(s->sft_status, new_pos, mode)) < 0)
|
||||||
if (result < 0l)
|
return (int)new_pos;
|
||||||
return (int)result;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s->sft_posit = result;
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s->sft_posit = new_pos;
|
||||||
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG DosSeek(unsigned hndl, LONG new_pos, COUNT mode)
|
ULONG DosSeek(unsigned hndl, LONG new_pos, COUNT mode)
|
||||||
@ -1018,22 +1006,26 @@ COUNT DosChangeDir(BYTE FAR * s)
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC VOID pop_dmp(dmatch FAR * dmp)
|
STATIC int pop_dmp(int rc, dmatch FAR * save_dta)
|
||||||
{
|
{
|
||||||
dmp->dm_attr_fnd = (BYTE) SearchDir.dir_attrib;
|
dta = save_dta;
|
||||||
dmp->dm_time = SearchDir.dir_time;
|
if (rc == SUCCESS)
|
||||||
dmp->dm_date = SearchDir.dir_date;
|
{
|
||||||
dmp->dm_size = (LONG) SearchDir.dir_size;
|
fmemcpy(save_dta, &sda_tmp_dm, 21 /*offsetof(save_dta->dm_attr_fnd)*/ );
|
||||||
ConvertName83ToNameSZ(dmp->dm_name, (BYTE FAR *) SearchDir.dir_name);
|
save_dta->dm_attr_fnd = SearchDir.dir_attrib;
|
||||||
|
save_dta->dm_time = SearchDir.dir_time;
|
||||||
|
save_dta->dm_date = SearchDir.dir_date;
|
||||||
|
save_dta->dm_size = SearchDir.dir_size;
|
||||||
|
ConvertName83ToNameSZ(save_dta->dm_name, SearchDir.dir_name);
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
|
COUNT DosFindFirst(UCOUNT attr, const char FAR * name)
|
||||||
{
|
{
|
||||||
int rc;
|
dmatch FAR *save_dta = dta;
|
||||||
register dmatch FAR *dmp = dta;
|
int rc = truename(name, PriPathName,
|
||||||
|
CDS_MODE_CHECK_DEV_PATH | CDS_MODE_ALLOW_WILDCARDS);
|
||||||
rc = truename(name, PriPathName,
|
|
||||||
CDS_MODE_CHECK_DEV_PATH | CDS_MODE_ALLOW_WILDCARDS);
|
|
||||||
if (rc < SUCCESS)
|
if (rc < SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
@ -1065,32 +1057,26 @@ COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
|
|||||||
SearchDir.dir_attrib = D_DEVICE;
|
SearchDir.dir_attrib = D_DEVICE;
|
||||||
SearchDir.dir_time = dos_gettime();
|
SearchDir.dir_time = dos_gettime();
|
||||||
SearchDir.dir_date = dos_getdate();
|
SearchDir.dir_date = dos_getdate();
|
||||||
p = (char *)FP_OFF(get_root(PriPathName));
|
p = (const char *)get_root(PriPathName);
|
||||||
memset(SearchDir.dir_name, ' ', FNAME_SIZE + FEXT_SIZE);
|
|
||||||
for (i = 0; i < FNAME_SIZE && *p && *p != '.'; i++)
|
for (i = 0; i < FNAME_SIZE && *p && *p != '.'; i++)
|
||||||
SearchDir.dir_name[i] = *p++;
|
SearchDir.dir_name[i] = *p++;
|
||||||
|
for (; i < FNAME_SIZE + FEXT_SIZE; i++)
|
||||||
|
SearchDir.dir_name[i] = ' ';
|
||||||
rc = SUCCESS;
|
rc = SUCCESS;
|
||||||
/* /// End of additions. - Ron Cemer ; heavily edited - Bart Oldeman */
|
/* /// End of additions. - Ron Cemer ; heavily edited - Bart Oldeman */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rc = dos_findfirst(attr, PriPathName);
|
rc = dos_findfirst(attr, PriPathName);
|
||||||
|
|
||||||
dta = dmp;
|
return pop_dmp(rc, save_dta);
|
||||||
if (rc == SUCCESS)
|
|
||||||
{
|
|
||||||
fmemcpy(dta, &sda_tmp_dm, 21);
|
|
||||||
pop_dmp(dmp);
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
COUNT DosFindNext(void)
|
COUNT DosFindNext(void)
|
||||||
{
|
{
|
||||||
COUNT rc;
|
dmatch FAR *save_dta = dta;
|
||||||
register dmatch FAR *dmp = dta;
|
|
||||||
|
|
||||||
/* findnext will always fail on a device name device name or volume id */
|
/* findnext will always fail on a device name or volume id */
|
||||||
if (dmp->dm_attr_fnd & (D_DEVICE | D_VOLID))
|
if (save_dta->dm_attr_fnd & (D_DEVICE | D_VOLID))
|
||||||
return DE_NFILES;
|
return DE_NFILES;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1111,21 +1097,13 @@ COUNT DosFindNext(void)
|
|||||||
* (12h, DE_NFILES)
|
* (12h, DE_NFILES)
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
printf("findnext: %d\n", dmp->dm_drive);
|
printf("findnext: %d\n", save_dta->dm_drive);
|
||||||
#endif
|
#endif
|
||||||
fmemcpy(&sda_tmp_dm, dmp, 21);
|
fmemcpy(dta = &sda_tmp_dm, save_dta, 21 /*offsetof(save_dta->dm_attr_fnd)*/ );
|
||||||
memset(&SearchDir, 0, sizeof(struct dirent));
|
memset(&SearchDir, 0, sizeof(struct dirent));
|
||||||
dta = &sda_tmp_dm;
|
return pop_dmp(sda_tmp_dm.dm_drive & 0x80
|
||||||
rc = (sda_tmp_dm.dm_drive & 0x80) ?
|
? network_redirector_fp(REM_FINDNEXT, &sda_tmp_dm)
|
||||||
network_redirector_fp(REM_FINDNEXT, &sda_tmp_dm) : dos_findnext();
|
: dos_findnext(), save_dta);
|
||||||
|
|
||||||
dta = dmp;
|
|
||||||
if (rc == SUCCESS)
|
|
||||||
{
|
|
||||||
fmemcpy(dmp, &sda_tmp_dm, 21);
|
|
||||||
pop_dmp(dmp);
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)
|
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)
|
||||||
|
40
kernel/dsk.c
40
kernel/dsk.c
@ -711,7 +711,7 @@ STATIC WORD Genblkdev(rqptr rp, ddt * pddt)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x67: /* get access flag */
|
case 0x67: /* get access flag */
|
||||||
rp->r_ai->AI_Flag = (descflags / DF_NOACCESS) & 1; /* bit 9 */
|
rp->r_ai->AI_Flag = (UBYTE)~(descflags / DF_NOACCESS) & 1; /* bit 9 */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return failure(E_CMD);
|
return failure(E_CMD);
|
||||||
@ -804,32 +804,22 @@ STATIC WORD dskerr(COUNT code)
|
|||||||
translate LBA sectors into CHS addressing
|
translate LBA sectors into CHS addressing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC int LBA_to_CHS(ULONG LBA_address, struct CHS *chs, const ddt * pddt)
|
STATIC void LBA_to_CHS(ULONG LBA_address, struct CHS *chs, const ddt * pddt)
|
||||||
{
|
{
|
||||||
/* we need the defbpb values since those are taken from the
|
/* we need the defbpb values since those are taken from the
|
||||||
BIOS, not from some random boot sector, except when
|
BIOS, not from some random boot sector, except when
|
||||||
we're dealing with a floppy */
|
we're dealing with a floppy */
|
||||||
|
|
||||||
const bpb *pbpb = hd(pddt->ddt_descflags) ? &pddt->ddt_defbpb : &pddt->ddt_bpb;
|
const bpb *p = hd(pddt->ddt_descflags) ? &pddt->ddt_defbpb : &pddt->ddt_bpb;
|
||||||
unsigned hs = pbpb->bpb_nsecs * pbpb->bpb_nheads;
|
unsigned hs = p->bpb_nsecs * p->bpb_nheads;
|
||||||
unsigned hsrem = (unsigned)(LBA_address % hs);
|
chs->Cylinder = 0xffffu;
|
||||||
|
if (hs > hiword(LBA_address)) /* LBA_address < hs * 0x10000ul */
|
||||||
LBA_address /= hs;
|
|
||||||
|
|
||||||
if (LBA_address > 1023ul)
|
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
chs->Cylinder = (unsigned)(LBA_address / hs);
|
||||||
printf("LBA-Transfer error : cylinder %lu > 1023\n", LBA_address);
|
hs = (unsigned)(LBA_address % hs);
|
||||||
#else
|
chs->Head = hs / p->bpb_nsecs;
|
||||||
put_string("LBA-Transfer error : cylinder > 1023\n");
|
chs->Sector = hs % p->bpb_nsecs + 1;
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
chs->Cylinder = (UWORD)LBA_address;
|
|
||||||
chs->Head = hsrem / pbpb->bpb_nsecs;
|
|
||||||
chs->Sector = hsrem % pbpb->bpb_nsecs + 1;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test for 64K boundary crossing and return count small */
|
/* Test for 64K boundary crossing and return count small */
|
||||||
@ -945,8 +935,16 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
|
|||||||
else
|
else
|
||||||
{ /* transfer data, using old bios functions */
|
{ /* transfer data, using old bios functions */
|
||||||
struct CHS chs;
|
struct CHS chs;
|
||||||
if (LBA_to_CHS(LBA_address, &chs, pddt))
|
LBA_to_CHS(LBA_address, &chs, pddt);
|
||||||
|
if (chs.Cylinder > 1023u)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("IO error: cylinder (%u) > 1023\n", chs.Cylinder);
|
||||||
|
#else
|
||||||
|
put_string("IO error: cylinder > 1023\n");
|
||||||
|
#endif
|
||||||
return failure(E_CMD); /*dskerr(1)*/
|
return failure(E_CMD); /*dskerr(1)*/
|
||||||
|
}
|
||||||
|
|
||||||
/* avoid overflow at end of track */
|
/* avoid overflow at end of track */
|
||||||
if (count > pddt->ddt_bpb.bpb_nsecs + 1 - chs.Sector)
|
if (count > pddt->ddt_bpb.bpb_nsecs + 1 - chs.Sector)
|
||||||
|
@ -411,6 +411,7 @@ _call_nls:
|
|||||||
push bp
|
push bp
|
||||||
mov bp, sp
|
mov bp, sp
|
||||||
push si
|
push si
|
||||||
|
push di
|
||||||
mov al, [bp + 4] ; subfct
|
mov al, [bp + 4] ; subfct
|
||||||
mov ah, 0x14
|
mov ah, 0x14
|
||||||
mov si, [bp + 6] ; nlsinfo
|
mov si, [bp + 6] ; nlsinfo
|
||||||
@ -427,6 +428,7 @@ _call_nls:
|
|||||||
jz nostore
|
jz nostore
|
||||||
mov [bp], bx
|
mov [bp], bx
|
||||||
nostore:
|
nostore:
|
||||||
|
pop di
|
||||||
pop si
|
pop si
|
||||||
pop bp
|
pop bp
|
||||||
ret
|
ret
|
||||||
|
@ -74,21 +74,18 @@ VOID ASMCFUNC int21_syscall(iregs FAR * irp)
|
|||||||
setvec(irp->AL, (intvec)MK_FP(irp->DS, irp->DX));
|
setvec(irp->AL, (intvec)MK_FP(irp->DS, irp->DX));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* DosVars - get/set dos variables */
|
case 0x33: /* DosVars - get/set dos variables */
|
||||||
case 0x33:
|
|
||||||
switch (irp->AL)
|
switch (irp->AL)
|
||||||
{
|
{
|
||||||
/* Get Ctrl-C flag */
|
case 0x01: /* Set Ctrl-C flag */
|
||||||
case 0x00:
|
break_ena = irp->DL & 1;
|
||||||
|
/* fall through so DL only low bit (as in MS-DOS) */
|
||||||
|
|
||||||
|
case 0x00: /* Get Ctrl-C flag */
|
||||||
irp->DL = break_ena;
|
irp->DL = break_ena;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Set Ctrl-C flag */
|
case 0x02: /* andrew schulman: get/set extended control break */
|
||||||
case 0x01:
|
|
||||||
break_ena = irp->DL & 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x02: /* andrew schulman: get/set extended control break */
|
|
||||||
{
|
{
|
||||||
UBYTE tmp = break_ena;
|
UBYTE tmp = break_ena;
|
||||||
break_ena = irp->DL & 1;
|
break_ena = irp->DL & 1;
|
||||||
@ -1247,31 +1244,31 @@ dispatch:
|
|||||||
case 0x5f:
|
case 0x5f:
|
||||||
if (lr.AL == 7 || lr.AL == 8)
|
if (lr.AL == 7 || lr.AL == 8)
|
||||||
{
|
{
|
||||||
struct cds FAR *cdsp = &CDSp[lr.DL];
|
if (lr.DL < lastdrive)
|
||||||
if (lr.DL >= lastdrive || FP_OFF(cdsp->cdsDpb) == 0)
|
|
||||||
{
|
{
|
||||||
rc = DE_INVLDDRV;
|
struct cds FAR *cdsp = CDSp + lr.DL;
|
||||||
goto error_exit;
|
if (FP_OFF(cdsp->cdsDpb)) /* letter of physical drive? */
|
||||||
|
{
|
||||||
|
cdsp->cdsFlags &= ~CDSPHYSDRV;
|
||||||
|
if (lr.AL == 7)
|
||||||
|
cdsp->cdsFlags |= CDSPHYSDRV;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (lr.AL == 7)
|
rc = DE_INVLDDRV;
|
||||||
cdsp->cdsFlags |= CDSPHYSDRV;
|
goto error_exit;
|
||||||
else
|
|
||||||
cdsp->cdsFlags &= ~CDSPHYSDRV;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
rc = -(int)network_redirector_mx(REM_DOREDIRECT, &lr, (void *)Int21AX);
|
||||||
|
/* the remote function manipulates *r directly !,
|
||||||
|
so we should not copy lr to r here */
|
||||||
|
r->AX = rc;
|
||||||
|
if (rc != SUCCESS)
|
||||||
{
|
{
|
||||||
rc = (int)network_redirector_mx(REM_DOREDIRECT, &lr, (void *)Int21AX);
|
SET_CARRY_FLAG();
|
||||||
/* the remote function manipulates *r directly !,
|
CritErrCode = rc; /* Maybe set */
|
||||||
so we should not copy lr to r here */
|
|
||||||
if (rc != SUCCESS)
|
|
||||||
{
|
|
||||||
CritErrCode = -rc; /* Maybe set */
|
|
||||||
SET_CARRY_FLAG();
|
|
||||||
}
|
|
||||||
r->AX = -rc;
|
|
||||||
goto real_exit;
|
|
||||||
}
|
}
|
||||||
break;
|
goto real_exit;
|
||||||
|
|
||||||
case 0x60: /* TRUENAME */
|
case 0x60: /* TRUENAME */
|
||||||
rc = DosTruename(MK_FP(lr.DS, lr.SI), adjust_far(FP_ES_DI));
|
rc = DosTruename(MK_FP(lr.DS, lr.SI), adjust_far(FP_ES_DI));
|
||||||
@ -1633,9 +1630,10 @@ STATIC VOID StartTrace(VOID)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* this function is called from an assembler wrapper function
|
/* this function is called from an assembler wrapper function and
|
||||||
and serves the internal dos calls - int2f/12xx and int2f/4a01,4a02.
|
serves the internal dos calls - int2f/12xx and int2f/4a01,4a02
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct int2f12regs {
|
struct int2f12regs {
|
||||||
#ifdef I386
|
#ifdef I386
|
||||||
#ifdef __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
@ -1654,7 +1652,7 @@ struct int2f12regs {
|
|||||||
UWORD di, si, bp;
|
UWORD di, si, bp;
|
||||||
xreg b, d, c, a;
|
xreg b, d, c, a;
|
||||||
UWORD ip, cs, flags;
|
UWORD ip, cs, flags;
|
||||||
UWORD callerARG1; /* used if called from INT2F/12 */
|
xreg callerARG1; /* used if called from INT2F/12 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* WARNING: modifications in `r' are used outside of int2F_12_handler()
|
/* WARNING: modifications in `r' are used outside of int2F_12_handler()
|
||||||
@ -1694,12 +1692,12 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
|
|||||||
r.DS = FP_SEG(&nul_dev);
|
r.DS = FP_SEG(&nul_dev);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x06: /* invoke critical error */
|
case 0x06: /* invoke critical error */
|
||||||
|
/* code, drive number, error, device header */
|
||||||
/* code, drive number, error, device header */
|
r.AL = CriticalError(r.callerARG1.b.h,
|
||||||
r.AL = CriticalError(r.callerARG1 >> 8,
|
(r.callerARG1.b.h & EFLG_CHAR)
|
||||||
(r.callerARG1 & (EFLG_CHAR << 8)) ? 0 :
|
? 0 : r.callerARG1.b.l,
|
||||||
r.callerARG1 & 0xff, r.DI, MK_FP(r.BP, r.SI));
|
r.DI, MK_FP(r.BP, r.SI));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x08: /* decrease SFT reference count */
|
case 0x08: /* decrease SFT reference count */
|
||||||
@ -1757,18 +1755,15 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0x12: /* get length of asciiz string */
|
case 0x12: /* get length of asciiz string */
|
||||||
|
|
||||||
r.CX = fstrlen(MK_FP(r.ES, r.DI)) + 1;
|
r.CX = fstrlen(MK_FP(r.ES, r.DI)) + 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x13:
|
case 0x13: /* uppercase character */
|
||||||
/* uppercase character */
|
/* for now, ASCII only because nls.c cannot handle DS!=SS */
|
||||||
/* for now, ASCII only because nls.c cannot handle DS!=SS */
|
r.AL = r.callerARG1.b.l;
|
||||||
r.AL = (unsigned char)r.callerARG1;
|
if (_islower(r.AL))
|
||||||
if (r.AL >= 'a' && r.AL <= 'z')
|
r.AL -= (UBYTE)('a' - 'A');
|
||||||
r.AL -= 'a' - 'A';
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x16:
|
case 0x16:
|
||||||
@ -1805,10 +1800,9 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
|
|||||||
;
|
;
|
||||||
; probable use: get sizeof(CDSentry)
|
; probable use: get sizeof(CDSentry)
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
struct cds FAR *cdsp = get_cds(r.callerARG1 & 0xff);
|
const struct cds FAR *cdsp;
|
||||||
|
if ((cdsp = get_cds(r.callerARG1.b.l)) == NULL)
|
||||||
if (cdsp == NULL)
|
|
||||||
{
|
{
|
||||||
r.FLAGS |= FLG_CARRY;
|
r.FLAGS |= FLG_CARRY;
|
||||||
break;
|
break;
|
||||||
@ -1817,7 +1811,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
|
|||||||
r.SI = FP_OFF(cdsp);
|
r.SI = FP_OFF(cdsp);
|
||||||
r.FLAGS &= ~FLG_CARRY;
|
r.FLAGS &= ~FLG_CARRY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0x18: /* get caller's registers */
|
case 0x18: /* get caller's registers */
|
||||||
|
|
||||||
@ -1880,6 +1874,15 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
|
|||||||
r.FLAGS &= ~FLG_CARRY;
|
r.FLAGS &= ~FLG_CARRY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* 0x26-0x29 & 0x2B, internal functions necessary for NLSFUNC */
|
||||||
|
case 0x26: /* Open File */
|
||||||
|
case 0x27: /* Close File */
|
||||||
|
case 0x28: /* Move File Pointer */
|
||||||
|
case 0x29: /* Read From File */
|
||||||
|
case 0x2B: /* IOctl */
|
||||||
|
r.FLAGS |= FLG_CARRY; /* Not implemented yet! */
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x2c: /* added by James Tabor For Zip Drives
|
case 0x2c: /* added by James Tabor For Zip Drives
|
||||||
Return Null Device Pointer */
|
Return Null Device Pointer */
|
||||||
/* by UDOS+RBIL: get header of SECOND device driver in device chain,
|
/* by UDOS+RBIL: get header of SECOND device driver in device chain,
|
||||||
|
@ -124,11 +124,20 @@ COUNT DosDevIOctl(lregs * r)
|
|||||||
attr = dev->dh_attr;
|
attr = dev->dh_attr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x0d:
|
||||||
|
/* NOTE: CX checked before check if get_dpb()->dpb_device->dh_attr
|
||||||
|
contains ATTR_GENIOCTL bit set
|
||||||
|
*/
|
||||||
|
if ((r->CX & ~0x4021) == 0x084A)
|
||||||
|
{ /* 084A/484A, 084B/484B, 086A/486A, 086B/486B */
|
||||||
|
r->AX = 0; /* (lock/unlock logical/physical volume) */
|
||||||
|
return SUCCESS; /* simulate success for MS-DOS 7+ SCANDISK etc. --LG */
|
||||||
|
}
|
||||||
|
|
||||||
case 0x04:
|
case 0x04:
|
||||||
case 0x05:
|
case 0x05:
|
||||||
case 0x08:
|
case 0x08:
|
||||||
case 0x09:
|
case 0x09:
|
||||||
case 0x0d:
|
|
||||||
case 0x0e:
|
case 0x0e:
|
||||||
case 0x0f:
|
case 0x0f:
|
||||||
case 0x11:
|
case 0x11:
|
||||||
@ -258,17 +267,10 @@ COUNT DosDevIOctl(lregs * r)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0x0d:
|
|
||||||
if ((r->CX & ~0x4021) == 0x084A)
|
|
||||||
{ /* 084A/484A, 084B/484B, 086A/486A, 086B/486B */
|
|
||||||
r->AX = 0; /* (lock/unlock logical/physical volume) */
|
|
||||||
break; /* simulate success for MS-DOS 7+ SCANDISK etc. --LG */
|
|
||||||
}
|
|
||||||
/* fall through */
|
|
||||||
|
|
||||||
case 0x04:
|
case 0x04:
|
||||||
case 0x05:
|
case 0x05:
|
||||||
case 0x08:
|
case 0x08:
|
||||||
|
case 0x0d:
|
||||||
case 0x11:
|
case 0x11:
|
||||||
execrequest:
|
execrequest:
|
||||||
execrh(&CharReqHdr, dev);
|
execrh(&CharReqHdr, dev);
|
||||||
|
@ -1,21 +1,26 @@
|
|||||||
; this one adapted from elks, http://elks.sourceforge.net
|
; this one adapted from elks, http://elks.sourceforge.net
|
||||||
; multiply cx:bx * dx:ax, result in dx:ax
|
; multiply cx:bx * dx:ax, result in dx:ax
|
||||||
|
; optimized by Arkady Belousov:
|
||||||
|
; dx:ax * cx:bx
|
||||||
|
; = xh:xl * yh:yl
|
||||||
|
; = xh:xl*yh*w + xh:xl*yl
|
||||||
|
; = [xh*yh*w*w +] (xl*yh + xh*yl)*w + xl*yl
|
||||||
|
|
||||||
%macro LMULU 0
|
%macro LMULU 0
|
||||||
|
|
||||||
push si
|
push cx
|
||||||
push cx
|
push si
|
||||||
mov si, ax ; save _ax in si
|
xchg si,ax ; si=xl (XCHG instead MOV)
|
||||||
mov ax, bx ; cx:ax = _cx:_bx
|
xchg ax,dx ; ax=xh (XCHG instead MOV)
|
||||||
mul dx ; dx:ax = _bx*_dx (forget dx)
|
mul bx ; dx:ax=xh*yl (forget dx)
|
||||||
xchg cx, ax ; cx = low(_dx*_bx)
|
xchg cx,ax ; cx=low(xh*yl), ax=yh
|
||||||
mul si ; dx:ax = _cx*_ax (forget dx)
|
mul si ; dx:ax=xl*yh (forget dx)
|
||||||
add cx, ax ; cx = low(_cx*_ax + _dx*_bx)
|
add cx,ax ; cx=low(xl*yh+xh*yl)
|
||||||
mov ax, si ; restore _ax
|
xchg ax,si ; ax=xl (XCHG instead MOV)
|
||||||
mul bx ; dx:ax = _bx*_ax
|
mul bx ; dx:ax=xl*yl
|
||||||
add dx, cx ; dx = high(_bx*_ax)+low(_cx*_ax + _dx*_bx)
|
add dx,cx
|
||||||
pop cx
|
pop si
|
||||||
pop si
|
pop cx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%endmacro
|
%endmacro
|
||||||
@ -25,86 +30,111 @@
|
|||||||
%macro LDIVMODU 0
|
%macro LDIVMODU 0
|
||||||
; this one is adapted from an assembly gem:
|
; this one is adapted from an assembly gem:
|
||||||
; gem writer: Norbert Juffa, norbert.juffa@amd.com
|
; gem writer: Norbert Juffa, norbert.juffa@amd.com
|
||||||
|
|
||||||
; Dividing 64-bit unsigned integers Assembler / 80386
|
; Dividing 64-bit unsigned integers Assembler / 80386
|
||||||
|
|
||||||
; Here is a division routine for dividing two 64-bit unsigned integers.
|
|
||||||
; I derived it by modifying some old
|
|
||||||
; 16-bit code for dividing 32-bit integers that I did several years ago for a
|
|
||||||
; Turbo-Pascal replacement library.
|
|
||||||
; If a 64-bit signed integer division is needed, appropriate shell code for
|
|
||||||
; this routine can easily be written.
|
|
||||||
;
|
|
||||||
; (adapted back to 32-bit by Bart Oldeman ;-))
|
; (adapted back to 32-bit by Bart Oldeman ;-))
|
||||||
;
|
; ...bugfixed and optimized by Arkady Belousov.
|
||||||
; __U4D divides two unsigned long numbers, the dividend and the divisor
|
|
||||||
|
; This macro divides two unsigned long numbers, the dividend and the divisor
|
||||||
; resulting in a quotient and a remainder.
|
; resulting in a quotient and a remainder.
|
||||||
;
|
;
|
||||||
; input:
|
; input:
|
||||||
; dx:ax = dividend
|
; dx:ax = dividend (x=xh:xl)
|
||||||
; cx:bx = divisor
|
; cx:bx = divisor (y=yh:yl)
|
||||||
;
|
|
||||||
; output:
|
; output:
|
||||||
; dx:ax = quotient of division of dividend by divisor
|
; dx:ax = quotient of division of dividend by divisor (q=x/y)
|
||||||
; cx:bx = remainder of division of dividend by divisor
|
; cx:bx = remainder of division of dividend by divisor (r=x%y)
|
||||||
;
|
|
||||||
; destroys:
|
; destroys:
|
||||||
; flags
|
; flags
|
||||||
;
|
;
|
||||||
|
%if XCPU < 386
|
||||||
|
|
||||||
test cx, cx ; divisor > 2^32-1 ?
|
jcxz %%div3216 ; cx=0 -> divisor < 2^16
|
||||||
jnz %%big_divisor ; yes, divisor > 32^32-1
|
|
||||||
cmp dx, bx ; only one division needed ? (ecx = 0)
|
|
||||||
jb %%one_div ; yes, one division sufficient
|
|
||||||
|
|
||||||
|
push si ; save temp
|
||||||
|
push di ; variables
|
||||||
|
|
||||||
xchg cx, ax ; save dividend-lo in cx, ax=0
|
push dx ; save
|
||||||
xchg ax, dx ; get dividend-hi in ax, dx=0
|
push ax ; dividend x
|
||||||
div bx ; quotient-hi in eax
|
mov si,bx ; si=yl
|
||||||
xchg ax, cx ; cx = quotient-hi, ax =dividend-lo
|
mov di,cx ; di:si=cx:bx=y
|
||||||
|
|
||||||
%%one_div:
|
|
||||||
div bx ; ax = quotient-lo
|
|
||||||
mov bx, dx ; bx = remainder-lo
|
|
||||||
mov dx, cx ; dx = quotient-hi(quotient in dx:ax)
|
|
||||||
xor cx, cx ; cx = remainder-hi (rem. in cx:bx)
|
|
||||||
ret
|
|
||||||
|
|
||||||
%%big_divisor:
|
|
||||||
push si ; save temp
|
|
||||||
push di ; variables
|
|
||||||
push dx ; save
|
|
||||||
push ax ; dividend
|
|
||||||
mov si, bx ; divisor now in
|
|
||||||
mov di, cx ; di:bx and cx:si
|
|
||||||
%%shift_loop:
|
%%shift_loop:
|
||||||
shr dx, 1 ; shift both
|
shr dx,1 ; shift both
|
||||||
rcr ax, 1 ; divisor and
|
rcr ax,1 ; divisor and
|
||||||
shr di, 1 ; and dividend
|
shr cx,1 ; and dividend
|
||||||
rcr bx, 1 ; right by 1 bit
|
rcr bx,1 ; right by 1 bit (rcr preserves ZF)
|
||||||
jnz %%shift_loop ; loop if di non-zero (rcr does not touch ZF)
|
jnz %%shift_loop ; until zero in cx (divisor < 2^16)
|
||||||
mov di, cx ; restore original divisor (di:si)
|
div bx ; ax=quotient q, di:si=y
|
||||||
div bx ; compute quotient
|
|
||||||
pop bx ; get dividend lo-word
|
mov cx,ax ; cx=q
|
||||||
mov cx, ax ; save quotient
|
mul di ; dx:ax=q*yh (forget dx)
|
||||||
mul di ; quotient * divisor hi-word (low only)
|
xchg bx,ax ; bx=low(q*yh) (XCHG instead MOV)
|
||||||
xchg ax, di ; save in di
|
mov ax,cx ; ax=q
|
||||||
mov ax, cx ; ax=quotient
|
mul si ; dx:ax=q*yl
|
||||||
mul si ; quotient * divisor lo-word
|
add dx,bx ; dx:ax=q*y, cx=q
|
||||||
add dx, di ; dx:ax = quotient * divisor
|
|
||||||
sub bx, ax ; dividend-lo - (quot.*divisor)-lo
|
pop bx ; bx=xl
|
||||||
mov ax, cx ; get quotient
|
sub bx,ax ; bx=xl-low(q*y)
|
||||||
pop cx ; restore dividend hi-word
|
xchg ax,cx ; ax=q (XCHG instead MOV)
|
||||||
sbb cx, dx ; subtract divisor * quot. from dividend
|
pop cx ; cx=xh
|
||||||
sbb dx, dx ; 0 if remainder > 0, else FFFFFFFFh
|
sbb cx,dx ; cx:bx=x-q*y=remainder r, ax=q
|
||||||
and si, dx ; nothing to add
|
|
||||||
and di, dx ; back if remainder positive
|
jae %%div_done ; if remainder < 0
|
||||||
add bx, si ; correct remaider
|
add bx,si
|
||||||
adc cx, di ; and quotient if
|
adc cx,di ; correct remainder (r+=y)
|
||||||
add ax, dx ; necessary
|
dec ax ; and quotient (q-=1)
|
||||||
xor dx, dx ; clear hi-word of quot (ax<=FFFFFFFFh)
|
%%div_done:
|
||||||
pop di ; restore temp
|
xor dx,dx ; dx:ax=0:q=q
|
||||||
pop si ; variables
|
|
||||||
|
pop di ; restore temp
|
||||||
|
pop si ; variables
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%endmacro
|
; dx:ax=x, bx=y, cx=0
|
||||||
|
; x=xh:xl=xh*w+xl=[xh/y]*y*w+xh%y*w+xl=[xh/y]*y*w+xt
|
||||||
|
; w=2^16, xh=x/w, xl=x%w, xt=xh%y*w+xl
|
||||||
|
; remainder = x%y = xt%y
|
||||||
|
; quotient = [x/y] = [xh/y]*w+xt/y
|
||||||
|
|
||||||
|
%%div3216:
|
||||||
|
cmp dx,bx ; xh < y ?
|
||||||
|
jb %%one_div ; yes, one division sufficient
|
||||||
|
|
||||||
|
xchg cx,ax ; ax=0, cx=xl
|
||||||
|
xchg ax,dx ; dx:ax=0:xh, cx=xl
|
||||||
|
div bx ; ax=xh/y, dx=xh%y, cx=xl
|
||||||
|
xchg ax,cx ; dx:ax=xh%y*w+xl=xt, cx=xh/y
|
||||||
|
|
||||||
|
%%one_div:
|
||||||
|
div bx ; ax=xt/y, dx=xt%d=x%d, cx=xh/y
|
||||||
|
mov bx,dx ; bx=x%d
|
||||||
|
mov dx,cx ; dx:ax=xh/y*w+xt/y=x/y
|
||||||
|
xor cx,cx ; cx:bx=x%d
|
||||||
|
ret
|
||||||
|
|
||||||
|
%else ; XCPU >= 386 (Svilen Stoianov and Luchezar Georgiev, Varna, Bulgaria)
|
||||||
|
|
||||||
|
push eax ; save eax.high
|
||||||
|
pop ax
|
||||||
|
push edx ; save edx.high
|
||||||
|
push ax
|
||||||
|
pop eax ; eax=x
|
||||||
|
push ecx ; save ecx.high
|
||||||
|
push bx
|
||||||
|
pop ecx ; ecx=y
|
||||||
|
|
||||||
|
xor edx,edx
|
||||||
|
div ecx ; eax=q, edx=r
|
||||||
|
|
||||||
|
push edx
|
||||||
|
pop bx
|
||||||
|
pop ecx ; restore ecx.high, cx:bx=r
|
||||||
|
push eax
|
||||||
|
pop ax
|
||||||
|
pop edx ; restore edx.high, dx:ax=q
|
||||||
|
push ax
|
||||||
|
pop eax ; restore eax.high
|
||||||
|
ret
|
||||||
|
|
||||||
|
%endif
|
||||||
|
%endmacro
|
||||||
|
@ -195,6 +195,12 @@ STATIC void PSPInit(void)
|
|||||||
/* this area reused for master environment */
|
/* this area reused for master environment */
|
||||||
/*p->ps_cmd.ctCount = 0;*/ /* local command line */
|
/*p->ps_cmd.ctCount = 0;*/ /* local command line */
|
||||||
/*p->ps_cmd.ctBuffer[0] = '\r';*/ /* command tail */
|
/*p->ps_cmd.ctBuffer[0] = '\r';*/ /* command tail */
|
||||||
|
|
||||||
|
/* !!! dirty hack: because bug in old FreeCOM, which wrongly
|
||||||
|
process empty environment in MS-DOS style, garbage empty
|
||||||
|
environment by dummy variable: --avb
|
||||||
|
*/
|
||||||
|
fmemcpy(&p->ps_cmd, "PATH=.", 6/*strlen("PATH=.")*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __WATCOMC__
|
#ifndef __WATCOMC__
|
||||||
@ -328,8 +334,10 @@ STATIC VOID FsConfig(VOID)
|
|||||||
for (i = 0; i < LoL->lastdrive; i++)
|
for (i = 0; i < LoL->lastdrive; i++)
|
||||||
{
|
{
|
||||||
struct cds FAR *pcds_table = &LoL->CDSp[i];
|
struct cds FAR *pcds_table = &LoL->CDSp[i];
|
||||||
fmemcpy(pcds_table->cdsCurrentPath, "A:\\\0", 4);
|
pcds_table->cdsCurrentPath[0] = 'A' + i;
|
||||||
pcds_table->cdsCurrentPath[0] += i;
|
pcds_table->cdsCurrentPath[1] = ':';
|
||||||
|
pcds_table->cdsCurrentPath[2] = '\\';
|
||||||
|
pcds_table->cdsCurrentPath[3] = '\0';
|
||||||
pcds_table->cdsFlags = 0;
|
pcds_table->cdsFlags = 0;
|
||||||
if (i < LoL->nblkdev && (LONG) dpb != -1l)
|
if (i < LoL->nblkdev && (LONG) dpb != -1l)
|
||||||
{
|
{
|
||||||
|
10
kernel/nls.c
10
kernel/nls.c
@ -122,8 +122,14 @@ COUNT muxLoadPkg(UWORD cp, UWORD cntry)
|
|||||||
/* make sure the NLSFUNC ID is updated */
|
/* make sure the NLSFUNC ID is updated */
|
||||||
#error "NLS_FREEDOS_NLSFUNC_VERSION == NLS_FREEDOS_NLSFUNC_ID"
|
#error "NLS_FREEDOS_NLSFUNC_VERSION == NLS_FREEDOS_NLSFUNC_ID"
|
||||||
#endif
|
#endif
|
||||||
if (muxGo(0, 0, NLS_FREEDOS_NLSFUNC_VERSION, 0, NLS_FREEDOS_NLSFUNC_ID, 0,
|
/* Install check must pass the FreeDOS NLSFUNC version as codepage (cp) and
|
||||||
(UWORD *)&id) != 0x14ff)
|
the FreeDOS NLSFUNC ID as buffer size (bufsize). If they match the
|
||||||
|
version in NLSFUNC, on return it will set BX (cp on entry) to FreeDOS
|
||||||
|
NLSFUNC ID. If not NULL, call_nls will set *id = BX on return.
|
||||||
|
Note: &id should be the pointer offset addressable via SS (SS:BP == &id)
|
||||||
|
*/
|
||||||
|
if (muxGo(NLSFUNC_INSTALL_CHECK, 0, NLS_FREEDOS_NLSFUNC_VERSION,
|
||||||
|
0, NLS_FREEDOS_NLSFUNC_ID, 0, (UWORD *)&id) != 0x14ff)
|
||||||
return DE_FILENOTFND; /* No NLSFUNC --> no load */
|
return DE_FILENOTFND; /* No NLSFUNC --> no load */
|
||||||
if (id != NLS_FREEDOS_NLSFUNC_ID) /* FreeDOS NLSFUNC will return */
|
if (id != NLS_FREEDOS_NLSFUNC_ID) /* FreeDOS NLSFUNC will return */
|
||||||
return DE_INVLDACC; /* This magic number */
|
return DE_INVLDACC; /* This magic number */
|
||||||
|
@ -77,11 +77,14 @@ long cooked_write(struct dhdr FAR **pdev, size_t n, char FAR *bp);
|
|||||||
sft FAR *get_sft(UCOUNT);
|
sft FAR *get_sft(UCOUNT);
|
||||||
|
|
||||||
/* dosfns.c */
|
/* dosfns.c */
|
||||||
|
#define SEEK_SET 0
|
||||||
|
#define SEEK_CUR 1
|
||||||
|
#define SEEK_END 2
|
||||||
const char FAR *get_root(const char FAR *);
|
const char FAR *get_root(const char FAR *);
|
||||||
BOOL check_break(void);
|
BOOL check_break(void);
|
||||||
UCOUNT GenericReadSft(sft far * sftp, UCOUNT n, void FAR * bp,
|
UCOUNT GenericReadSft(sft far * sftp, UCOUNT n, void FAR * bp,
|
||||||
COUNT * err, BOOL force_binary);
|
COUNT * err, BOOL force_binary);
|
||||||
COUNT SftSeek(int sft_idx, LONG new_pos, COUNT mode);
|
COUNT SftSeek(int sft_idx, LONG new_pos, unsigned mode);
|
||||||
/*COUNT DosRead(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err); */
|
/*COUNT DosRead(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err); */
|
||||||
void BinarySftIO(int sft_idx, void *bp, int mode);
|
void BinarySftIO(int sft_idx, void *bp, int mode);
|
||||||
#define BinaryIO(hndl, bp, mode) BinarySftIO(get_sft_idx(hndl), bp, mode)
|
#define BinaryIO(hndl, bp, mode) BinarySftIO(get_sft_idx(hndl), bp, mode)
|
||||||
@ -101,7 +104,7 @@ BOOL DosGetFree(UBYTE drive, UWORD * spc, UWORD * navc,
|
|||||||
UWORD * bps, UWORD * nc);
|
UWORD * bps, UWORD * nc);
|
||||||
COUNT DosGetCuDir(UBYTE drive, BYTE FAR * s);
|
COUNT DosGetCuDir(UBYTE drive, BYTE FAR * s);
|
||||||
COUNT DosChangeDir(BYTE FAR * s);
|
COUNT DosChangeDir(BYTE FAR * s);
|
||||||
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name);
|
COUNT DosFindFirst(UCOUNT attr, const char FAR * name);
|
||||||
COUNT DosFindNext(void);
|
COUNT DosFindNext(void);
|
||||||
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp);
|
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp);
|
||||||
COUNT DosSetFtimeSft(int sft_idx, date dp, time tp);
|
COUNT DosSetFtimeSft(int sft_idx, date dp, time tp);
|
||||||
@ -374,7 +377,6 @@ void child_psp(seg_t para, seg_t cur_psp, seg_t beyond);
|
|||||||
void return_user(void);
|
void return_user(void);
|
||||||
COUNT DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp);
|
COUNT DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp);
|
||||||
ULONG SftGetFsize(int sft_idx);
|
ULONG SftGetFsize(int sft_idx);
|
||||||
VOID InitPSP(VOID);
|
|
||||||
#ifdef __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
# pragma aux return_user aborts
|
# pragma aux return_user aborts
|
||||||
#endif
|
#endif
|
||||||
|
@ -303,7 +303,7 @@ static void load_transfer(seg_t ds, exec_blk *ep, int mode)
|
|||||||
if (mode == LOADNGO)
|
if (mode == LOADNGO)
|
||||||
{
|
{
|
||||||
/* build the user area on the stack */
|
/* build the user area on the stack */
|
||||||
iregs FAR *irp = (iregs FAR *)(ep->exec.stack - sizeof(iregs));
|
iregs FAR *irp = (iregs FAR *)ep->exec.stack - 1;
|
||||||
|
|
||||||
/* start allocating REGs (as in MS-DOS - some demos expect them so --LG) */
|
/* start allocating REGs (as in MS-DOS - some demos expect them so --LG) */
|
||||||
/* see http://www.beroset.com/asm/showregs.asm */
|
/* see http://www.beroset.com/asm/showregs.asm */
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
-batch -nologo -WX
|
|
||||||
-Zlp1
|
|
||||||
-f- -Osb1V4e -Gsry
|
|
||||||
-Fc
|
|
||||||
-I..\hdr
|
|
@ -59,10 +59,6 @@ typedef signed short sword;
|
|||||||
typedef unsigned long dword;
|
typedef unsigned long dword;
|
||||||
typedef signed long sdword;
|
typedef signed long sdword;
|
||||||
|
|
||||||
/* These structures need to be byte packed, if your compiler
|
|
||||||
does not do this by default, add the appropriate command,
|
|
||||||
such as #pragma pack(1) here, protected with #ifdefs of course.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Displays command line syntax */
|
/* Displays command line syntax */
|
||||||
void showUsage(void)
|
void showUsage(void)
|
||||||
|
21
sys/sys.c
21
sys/sys.c
@ -29,7 +29,7 @@
|
|||||||
#define DEBUG
|
#define DEBUG
|
||||||
/* #define DDEBUG */
|
/* #define DDEBUG */
|
||||||
|
|
||||||
#define SYS_VERSION "v3.2"
|
#define SYS_VERSION "v3.3"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <dos.h>
|
#include <dos.h>
|
||||||
@ -483,13 +483,13 @@ void truename(char far *dest, const char *src);
|
|||||||
"int 0x21" \
|
"int 0x21" \
|
||||||
parm [es di] [si];
|
parm [es di] [si];
|
||||||
|
|
||||||
int generic_block_ioctl(unsigned char drive, unsigned cx, unsigned char *par);
|
int generic_block_ioctl(unsigned drive, unsigned cx, unsigned char *par);
|
||||||
#pragma aux generic_block_ioctl = \
|
#pragma aux generic_block_ioctl = \
|
||||||
"mov ax, 0x440d" \
|
"mov ax, 0x440d" \
|
||||||
"int 0x21" \
|
"int 0x21" \
|
||||||
"sbb ax, ax" \
|
"sbb ax, ax" \
|
||||||
value [ax] \
|
value [ax] \
|
||||||
parm [bl] [cx] [dx];
|
parm [bx] [cx] [dx]; /* BH must be 0 for lock! */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -541,14 +541,14 @@ void reset_drive(int DosDrive)
|
|||||||
intdos(®s, ®s);
|
intdos(®s, ®s);
|
||||||
} /* reset_drive */
|
} /* reset_drive */
|
||||||
|
|
||||||
int generic_block_ioctl(unsigned char drive, unsigned cx, unsigned char *par)
|
int generic_block_ioctl(unsigned drive, unsigned cx, unsigned char *par)
|
||||||
{
|
{
|
||||||
union REGS regs;
|
union REGS regs;
|
||||||
|
|
||||||
regs.x.ax = 0x440d;
|
regs.x.ax = 0x440d;
|
||||||
regs.x.cx = cx;
|
regs.x.cx = cx;
|
||||||
regs.x.dx = (unsigned)par;
|
regs.x.dx = (unsigned)par;
|
||||||
regs.h.bl = drive + 1;
|
regs.x.bx = drive; /* BH must be 0 for lock! */
|
||||||
intdos(®s, ®s);
|
intdos(®s, ®s);
|
||||||
return regs.x.cflag;
|
return regs.x.cflag;
|
||||||
} /* generic_block_ioctl */
|
} /* generic_block_ioctl */
|
||||||
@ -692,7 +692,7 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* lock drive */
|
/* lock drive */
|
||||||
generic_block_ioctl((unsigned char)drive + 1, 0x84a, NULL);
|
generic_block_ioctl(drive + 1, 0x84a, NULL);
|
||||||
|
|
||||||
reset_drive(drive);
|
reset_drive(drive);
|
||||||
/* suggestion: allow reading from a boot sector or image file here */
|
/* suggestion: allow reading from a boot sector or image file here */
|
||||||
@ -752,7 +752,7 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
printf("FAT type: FAT32\n");
|
printf("FAT type: FAT32\n");
|
||||||
/* get default bpb (but not for floppies) */
|
/* get default bpb (but not for floppies) */
|
||||||
if (drive >= 2 &&
|
if (drive >= 2 &&
|
||||||
generic_block_ioctl((unsigned char)drive + 1, 0x4860, default_bpb) == 0)
|
generic_block_ioctl(drive + 1, 0x4860, default_bpb) == 0)
|
||||||
correct_bpb((struct bootsectortype *)(default_bpb + 7 - 11), bs);
|
correct_bpb((struct bootsectortype *)(default_bpb + 7 - 11), bs);
|
||||||
|
|
||||||
#ifdef WITHFAT32 /* copy one of the FAT32 boot sectors */
|
#ifdef WITHFAT32 /* copy one of the FAT32 boot sectors */
|
||||||
@ -767,7 +767,7 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
{ /* copy the FAT12/16 CHS+LBA boot sector */
|
{ /* copy the FAT12/16 CHS+LBA boot sector */
|
||||||
printf("FAT type: FAT1%c\n", fs + '0' - 10);
|
printf("FAT type: FAT1%c\n", fs + '0' - 10);
|
||||||
if (drive >= 2 &&
|
if (drive >= 2 &&
|
||||||
generic_block_ioctl((unsigned char)drive + 1, 0x860, default_bpb) == 0)
|
generic_block_ioctl(drive + 1, 0x860, default_bpb) == 0)
|
||||||
correct_bpb((struct bootsectortype *)(default_bpb + 7 - 11), bs);
|
correct_bpb((struct bootsectortype *)(default_bpb + 7 - 11), bs);
|
||||||
memcpy(newboot, fs == FAT16 ? fat16com : fat12com, SEC_SIZE);
|
memcpy(newboot, fs == FAT16 ? fat16com : fat12com, SEC_SIZE);
|
||||||
}
|
}
|
||||||
@ -782,7 +782,8 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
|
|
||||||
bs = (struct bootsectortype *)&newboot;
|
bs = (struct bootsectortype *)&newboot;
|
||||||
|
|
||||||
memcpy(bs->OemName, "FreeDOS ", 8);
|
/* originally OemName was "FreeDOS", changed for better compatibility */
|
||||||
|
memcpy(bs->OemName, "FRDOS4.1", 8);
|
||||||
|
|
||||||
#ifdef WITHFAT32
|
#ifdef WITHFAT32
|
||||||
if (fs == FAT32)
|
if (fs == FAT32)
|
||||||
@ -893,7 +894,7 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both
|
|||||||
reset_drive(drive);
|
reset_drive(drive);
|
||||||
|
|
||||||
/* unlock_drive */
|
/* unlock_drive */
|
||||||
generic_block_ioctl((unsigned char)drive + 1, 0x86a, NULL);
|
generic_block_ioctl(drive + 1, 0x86a, NULL);
|
||||||
} /* put_boot */
|
} /* put_boot */
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user