mirror of https://github.com/FDOS/kernel.git
Added protection for FS:, GS:, update makefiles to use CC and CL.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@396 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
78e7cee01c
commit
11be0d22e4
|
@ -1,3 +1,10 @@
|
|||
2002 Aug xx - Build 2027
|
||||
-------- Bart Oldeman (bart@dosemu.org)
|
||||
+ Changes Tom
|
||||
|
||||
+ Changes Bart
|
||||
* patchobj makefile correction
|
||||
* printf uses va_list etc.
|
||||
2002 May 9 - Build 2026b
|
||||
-------- Bart Oldeman (bart@dosemu.org)
|
||||
+ Changes Tom
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@if \%COMPILER% == \TURBOCPP set MAKE=%TP1_BASE%\bin\make
|
||||
@if \%COMPILER% == \TC3 set MAKE=%TC3_BASE%\bin\make
|
||||
@if \%COMPILER% == \BC5 set MAKE=%BC5_BASE%\bin\make
|
||||
@if \%COMPILER% == \WATCOM set MAKE=wmake /ms
|
||||
@if \%COMPILER% == \WATCOM set MAKE=wmake /ms /h
|
||||
@if \%COMPILER% == \MSCL8 set MAKE=%MS_BASE%\bin\nmake /nologo
|
||||
|
||||
:make_set
|
||||
|
|
|
@ -130,16 +130,17 @@ irp_hi equ 26
|
|||
; no need to save/restore anything
|
||||
|
||||
; error 1 2 3
|
||||
%macro ProtectHighPartOfRegistersOn386 0
|
||||
%macro Protect386Registers 0
|
||||
%endmacro
|
||||
|
||||
%macro RestoreHighPartOfRegistersOn386 0
|
||||
%macro Restore386Registers 0
|
||||
%endmacro
|
||||
|
||||
|
||||
%ELSE
|
||||
%macro ProtectHighPartOfRegistersOn386 0
|
||||
%macro Protect386Registers 0
|
||||
|
||||
%ifdef WATCOM
|
||||
ror eax,16
|
||||
push ax
|
||||
ror eax,16
|
||||
|
@ -152,10 +153,16 @@ irp_hi equ 26
|
|||
ror edx,16
|
||||
push dx
|
||||
ror edx,16
|
||||
%else
|
||||
push fs
|
||||
push gs
|
||||
%endif
|
||||
|
||||
%endmacro
|
||||
|
||||
%macro RestoreHighPartOfRegistersOn386 0
|
||||
%macro Restore386Registers 0
|
||||
|
||||
%ifdef WATCOM
|
||||
ror edx,16
|
||||
pop dx
|
||||
ror edx,16
|
||||
|
@ -168,6 +175,11 @@ irp_hi equ 26
|
|||
ror eax,16
|
||||
pop ax
|
||||
ror eax,16
|
||||
%else
|
||||
pop gs
|
||||
pop fs
|
||||
%endif
|
||||
|
||||
%endmacro
|
||||
|
||||
%ENDIF
|
||||
|
|
|
@ -244,9 +244,7 @@ reloc_call_int21_handler:
|
|||
sti
|
||||
PUSH$ALL
|
||||
mov bp,sp
|
||||
|
||||
ProtectHighPartOfRegistersOn386
|
||||
|
||||
Protect386Registers
|
||||
;
|
||||
; Create kernel reference frame.
|
||||
;
|
||||
|
@ -378,17 +376,16 @@ int21_exit_nodec:
|
|||
pop si
|
||||
|
||||
%IFDEF I386
|
||||
sub bp,8
|
||||
sub bp,8
|
||||
%endif
|
||||
|
||||
cli
|
||||
mov ss,si
|
||||
mov sp,bp
|
||||
|
||||
int21_ret:
|
||||
RestoreHighPartOfRegistersOn386
|
||||
|
||||
POP$ALL
|
||||
int21_ret:
|
||||
Restore386Registers
|
||||
POP$ALL
|
||||
|
||||
;
|
||||
; ... and return.
|
||||
|
@ -452,7 +449,6 @@ int2526:
|
|||
push ds
|
||||
push es
|
||||
|
||||
|
||||
mov cx, sp ; save stack frame
|
||||
mov dx, ss
|
||||
|
||||
|
@ -466,6 +462,8 @@ int2526:
|
|||
mov sp,_disk_api_tos
|
||||
sti
|
||||
|
||||
Protect386Registers
|
||||
|
||||
push dx
|
||||
push cx ; save user stack
|
||||
|
||||
|
@ -478,6 +476,8 @@ int2526:
|
|||
pop cx
|
||||
pop dx ; restore user stack
|
||||
|
||||
Restore386Registers
|
||||
|
||||
; restore foreground stack here
|
||||
cli
|
||||
mov ss, dx
|
||||
|
|
|
@ -106,6 +106,7 @@ IntDosCal:
|
|||
; UWORD ip,cs,flags;
|
||||
; UWORD callerARG1;
|
||||
;};
|
||||
Protect386Registers
|
||||
push ax
|
||||
push cx
|
||||
push dx
|
||||
|
@ -118,7 +119,7 @@ IntDosCal:
|
|||
|
||||
mov ax,DGROUP
|
||||
mov ds,ax
|
||||
extern _int2F_12_handler:wrt HGROUP
|
||||
extern _int2F_12_handler:wrt HGROUP
|
||||
call _int2F_12_handler
|
||||
|
||||
pop es
|
||||
|
@ -130,6 +131,7 @@ IntDosCal:
|
|||
pop dx
|
||||
pop cx
|
||||
pop ax
|
||||
Restore386Registers
|
||||
|
||||
iret
|
||||
|
||||
|
|
|
@ -559,6 +559,7 @@ clk_and_blk_common:
|
|||
push si
|
||||
push di
|
||||
push es
|
||||
Protect386Registers
|
||||
|
||||
mov ds,[cs:_TEXT_DGROUP] ;
|
||||
|
||||
|
@ -573,6 +574,7 @@ clk_and_blk_common:
|
|||
mov word [es:bx+status],ax ; mark operation complete
|
||||
|
||||
|
||||
Restore386Registers
|
||||
pop es
|
||||
pop di
|
||||
pop si
|
||||
|
|
|
@ -26,7 +26,7 @@ HDR=../hdr/
|
|||
# 'standard' compiles
|
||||
|
||||
.c.obj :
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
$(CC) $(CFLAGS) $<
|
||||
$(STDPATCH) $*.obj
|
||||
|
||||
# *List Macros*
|
||||
|
@ -228,32 +228,32 @@ task.obj: task.c $(HEADERS) $(CONFIGURATION)
|
|||
# patchobj $*.obj $(INITPATCH)
|
||||
|
||||
config.obj: config.c $(INITHEADERS) $(HEADERS) $(CONFIGURATION)
|
||||
$(CC) $(INITCFLAGS) -c $*.c
|
||||
$(CC) $(INITCFLAGS) $*.c
|
||||
$(INITPATCH) $*.obj
|
||||
|
||||
initoem.obj: initoem.c $(INITHEADERS) $(HEADERS) $(CONFIGURATION)
|
||||
$(CC) $(INITCFLAGS) -c $*.c
|
||||
$(CC) $(INITCFLAGS) $*.c
|
||||
$(INITPATCH) $*.obj
|
||||
|
||||
main.obj: main.c $(INITHEADERS) $(HEADERS) $(CONFIGURATION)
|
||||
$(CC) $(INITCFLAGS) -c $*.c
|
||||
$(CC) $(INITCFLAGS) $*.c
|
||||
$(INITPATCH) $*.obj
|
||||
|
||||
inithma.obj: inithma.c $(INITHEADERS) $(HEADERS) $(CONFIGURATION)
|
||||
$(CC) $(INITCFLAGS) -c $*.c
|
||||
$(CC) $(INITCFLAGS) $*.c
|
||||
$(INITPATCH) $*.obj
|
||||
|
||||
dyninit.obj: dyninit.c $(INITHEADERS) $(HEADERS) $(CONFIGURATION)
|
||||
$(CC) $(INITCFLAGS) -c $*.c
|
||||
$(CC) $(INITCFLAGS) $*.c
|
||||
$(INITPATCH) $*.obj
|
||||
|
||||
initdisk.obj: initdisk.c $(INITHEADERS) $(HEADERS) $(CONFIGURATION)
|
||||
$(CC) $(INITCFLAGS) -c $*.c
|
||||
$(CC) $(INITCFLAGS) $*.c
|
||||
$(INITPATCH) $*.obj
|
||||
|
||||
#the printf for INIT_TEXT - yet another special case, this file includes prf.c
|
||||
iprf.obj: iprf.c prf.c $(HDR)\portab.h $(CONFIGURATION)
|
||||
$(CC) $(INITCFLAGS) -c $*.c
|
||||
$(CC) $(INITCFLAGS) $*.c
|
||||
$(INITPATCH) $*.obj
|
||||
|
||||
# Log: makefile,v
|
||||
|
|
|
@ -39,6 +39,8 @@ segment HMA_TEXT
|
|||
; Part of Function 38h
|
||||
;
|
||||
_reloc_call_CharMapSrvc:
|
||||
|
||||
Protect386Registers
|
||||
push ds
|
||||
push es
|
||||
push bp
|
||||
|
@ -68,6 +70,7 @@ _reloc_call_CharMapSrvc:
|
|||
pop bp
|
||||
pop es
|
||||
pop ds
|
||||
Restore386Registers
|
||||
retf ; Return far
|
||||
; Log: nlssupt.asm,v
|
||||
;
|
||||
|
|
16
sys/makefile
16
sys/makefile
|
@ -11,9 +11,6 @@ NASMFLAGS = -DSYS=1
|
|||
|
||||
# *List Macros*
|
||||
|
||||
BIN2C_EXE_dependencies = \
|
||||
bin2c.obj
|
||||
|
||||
SYS_EXE_dependencies = \
|
||||
sys.obj \
|
||||
fdkrncfg.obj \
|
||||
|
@ -22,8 +19,8 @@ SYS_EXE_dependencies = \
|
|||
# *Explicit Rules*
|
||||
production: bin2c.com ..\bin\sys.com
|
||||
|
||||
bin2c.com: $(BIN2C_EXE_dependencies)
|
||||
$(CC) $(CFLAGST) $(BIN2C_EXE_dependencies)
|
||||
bin2c.com: bin2c.c
|
||||
$(CL) $(CFLAGST) $(TINY) bin2c.c
|
||||
|
||||
..\bin\sys.com: sys.com
|
||||
copy sys.com ..\bin
|
||||
|
@ -38,12 +35,12 @@ b_fat32.h: ..\boot\b_fat32.bin bin2c.com
|
|||
.\bin2c ..\boot\b_fat32.bin b_fat32.h b_fat32
|
||||
|
||||
prf.obj: ..\kernel\prf.c
|
||||
$(CC) $(CFLAGS) -c ..\kernel\prf.c
|
||||
$(CC) $(CFLAGS) ..\kernel\prf.c
|
||||
|
||||
fdkrncfg.obj: fdkrncfg.c ..\hdr\kconfig.h
|
||||
|
||||
sys.com: $(SYS_EXE_dependencies)
|
||||
$(CC) $(CFLAGST) $(SYS_EXE_dependencies)
|
||||
$(CL) $(CFLAGST) $(TINY) $(SYS_EXE_dependencies)
|
||||
|
||||
clobber: clean
|
||||
-$(RM) bin2c.com sys.com b_fat12.h b_fat16.h b_fat32.h
|
||||
|
@ -52,11 +49,8 @@ clean:
|
|||
-$(RM) *.obj *.bak *.crf *.xrf *.map *.lst *.las *.cod *.err status.me
|
||||
|
||||
# *Individual File Dependencies*
|
||||
bin2c.obj: bin2c.c
|
||||
$(CC) $(CFLAGS) -c $*.c
|
||||
|
||||
sys.obj: sys.c ..\hdr\portab.h ..\hdr\device.h b_fat12.h b_fat16.h b_fat32.h
|
||||
$(CC) $(CFLAGS) -c $*.c
|
||||
$(CC) $(CFLAGS) $*.c
|
||||
|
||||
# Log: makefile,v
|
||||
#
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
CFLAGS = -I$(INCLUDEPATH) -I..\hdr
|
||||
|
||||
production: patchobj.exe exeflat.exe
|
||||
production: patchobj.com exeflat.exe
|
||||
|
||||
patchobj.exe: patchobj.c
|
||||
$(CC) $(CFLAGST) $(CFLAGS) patchobj.c
|
||||
patchobj.com: patchobj.c
|
||||
$(CL) $(CFLAGST) $(TINY) $(CFLAGS) patchobj.c
|
||||
|
||||
exeflat.exe: exeflat.c ..\hdr\exe.h
|
||||
$(CC) $(CFLAGSC) $(CFLAGS) exeflat.c
|
||||
$(CL) $(CFLAGSC) $(CFLAGS) exeflat.c
|
||||
|
||||
|
||||
clobber: clean
|
||||
$(RM) bin2c.com exeflat.exe patchobj.exe patchobj.com
|
||||
$(RM) bin2c.com exeflat.exe patchobj.com
|
||||
|
||||
clean:
|
||||
$(RM) *.obj *.bak *.crf *.xrf *.map *.lst *.las *.cod *.err status.me
|
||||
|
|
Loading…
Reference in New Issue