Skip to content

Commit

Permalink
guard kernel against being overwritten by config environment
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckmann committed Aug 11, 2024
1 parent 8d769e6 commit f9bad8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions drbio/biosinit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,10 @@ dos_r70:
pop es
load_e10:
call add_comspec_to_env ; append / update COMSPEC in config env
if BIO_SEG ge 70h
; relocate config environment to segment 60 if kernel is not in the way
call copy_config_env_to_seg60
endif
mov ax,(MS_X_EXEC * 256)+0 ; Exec the Command Processor
mov bx,offset exec_env ; Get the Parameter Block Address
mov dx,offset shell ; and the Command Processor
Expand Down
7 changes: 4 additions & 3 deletions drbio/genercfg.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4040,15 +4040,16 @@ INITDATA ends

INITENV segment public para 'INITDATA'
Public envstart
envstart db 251 dup (0) ; initial env buffer
Public envend
envstart db 251 dup (0) ; <<< initial env buffer, copied to seg 60
Public envend ;
envend dw 0 ; make it double null terminated
db 1Ah ; EOF marker env buffer
Public boot_options, boot_switches
boot_options dw 0
boot_switches db 0
; set by BIOS to either the SHIFT states, or to F5KEY or F8KEY

; >>> end of range copied to seg 60
; may not exceed 256 bytes
EXE_LENGTH equ 001Ch

exeBuffer label word
Expand Down

0 comments on commit f9bad8d

Please sign in to comment.