Skip to content

Commit

Permalink
change build flag UNCOMPRESSED to COMPRESSED and replace ifdefs by if
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckmann committed Jul 27, 2024
1 parent 40e87c0 commit 78f2ee6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

!include platform.mak

!ifdef SINGLEFILE
!ifeq SINGLEFILE 1
WMAKE_FLAGS += SINGLEFILE=1
!endif

!ifdef UNCOMPRESSED
WMAKE_FLAGS += UNCOMPRESSED=1
!ifeq COMPRESSED 0
WMAKE_FLAGS += COMPRESSED=0
COMPKERN_FLAGS += uncompressed
!endif

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ directory of the components. The built binaries are then placed into the _bin_
subdirectory for the components, like _drbio/bin/drbio.sys_.

You may generate uncompressed DRBIO.SYS and DRDOS.SYS binaries by invoking
`wmake UNCOMPRESSED=1` from the main directory or the directories of the
`wmake COMPRESSED=0` from the main directory or the directories of the
components.

## Building single-file kernel
Expand Down
15 changes: 10 additions & 5 deletions drbio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@

!include ../platform.mak

!ifdef SINGLEFILE
WASM_FLAGS += -DSINGLEFILE
!ifeq SINGLEFILE 1
WASM_FLAGS += -DSINGLEFILE=1
!else
WASM_FLAGS += -DSINGLEFILE=0
!endif
!ifdef UNCOMPRESSED
WASM_FLAGS += -DUNCOMPRESSED

!ifeq COMPRESSED 0
WASM_FLAGS += -DCOMPRESSED=0
!else
WASM_FLAGS += -DCOMPRESSED=1
!endif

WASM_FLAGS += -DSVARDOS
Expand All @@ -24,7 +29,7 @@ objs += bin/biosinit.obj bin/config.obj bin/bdosldr.obj bin/genercfg.obj
objs += bin/nlsfunc.obj

bin/drbio.sys : bin/drbio.bin
!ifdef UNCOMPRESSED
!ifeq COMPRESSED 0
rm -f $@
$(CP) $< $@
!else
Expand Down
2 changes: 1 addition & 1 deletion drbio/bdosldr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
; ENDLOG


ifndef SINGLEFILE
if SINGLEFILE eq 0

include request.equ
include driver.equ
Expand Down
8 changes: 4 additions & 4 deletions drbio/biosinit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ INITCODE segment public byte 'INITCODE'
extrn config:near ; CONFIG.SYS Processor
extrn crlf:near ; Output CR/LF to screen
extrn resident_device_init:near ; Device Driver Init
ifndef SINGLEFILE
if SINGLEFILE eq 0
extrn read_dos:near ; load DOS file
extrn dos_version_check:near
endif
Expand Down Expand Up @@ -256,7 +256,7 @@ biosinit30:
mov dos_cseg,ax ; a relocated DOS image will live here

; Move BDOS to dos_cseg segment if we have combined BIO/BDIOS file
ifdef SINGLEFILE
if SINGLEFILE eq 1
push ds
mov current_dos,ax ; prevent relocated_init from
mov es,ax ; trying to load BDOS file
Expand Down Expand Up @@ -329,7 +329,7 @@ relocated_init:
mov ax,0100h ; the multi tasker (386 or above)
dont_align:
mov free_seg,ax ; and save as first Free Segment
ifndef SINGLEFILE
if SINGLEFILE eq 0
cmp current_dos,0 ; does the OEM want us to read
jnz dos_reloc ; the DOS file from disk?
mov ax,dos_cseg
Expand Down Expand Up @@ -623,7 +623,7 @@ config_start:
mov ax,3306h
int 21h ; get true version
mov dosVersion,bx ; and plant in initial PSP
ifndef SINGLEFILE
if SINGLEFILE eq 0
call dos_version_check ; make sure we are on correct DOS
endif
mov ax,4458h
Expand Down
5 changes: 0 additions & 5 deletions drbio/config.equ
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@
KERNFLG_COMP equ 1 ; bit set if file is compressed
KERNFLG_COMBINED equ 80h ; set if combined BIO/BDOS file

;ifdef SINGLEFILE
;BIO_SEGMENT equ 60h
;else
BIO_SEGMENT equ 70h
;endif


MOVE_DOWN equ 1800h ; start relocated code 96K down

Expand Down
3 changes: 2 additions & 1 deletion drbio/init.asm
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ uncompress_and_relocate_kernel:
; uncompression and potential relocation (kernel may be loaded
; to a different segment than 70)
@@determine_compressed_size:
ifdef SINGLEFILE
if SINGLEFILE eq 1
; if combined BIO/BDOS: we get the size of the zero-compressed area
; which is stored as paragraphs from the first word of the compressed
; area. The word following is the size in paras after
Expand Down Expand Up @@ -773,6 +773,7 @@ endif
@@uncompress_fini:
push cs
pop ds ; restore ds

pop dx
pop cx
pop bx
Expand Down
3 changes: 1 addition & 2 deletions drdos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@

!include ../platform.mak

!ifdef UNCOMPRESSED
!ifeq COMPRESSED 0
COMPBDOS_FLAGS=uncompressed
WASM_FLAGS += -DUNCOMPRESSED
!else
COMPBDOS_FLAGS=
!endif
Expand Down

0 comments on commit 78f2ee6

Please sign in to comment.