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