[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
68000 only version of Mint
Hi,
I have made a few changes to the mint 1.10 sources to get a new
flavour of Mint: a version for 68000 only. The result is nearly
10kB shorter and perhabs a little faster than vanilla mint.prg.
cu,
Robert
-------------------------------------------------------------------------
diff -cr mint.org/bios.c mint.110/bios.c
*** mint.org/bios.c Fri Feb 11 18:16:12 1994
--- mint.110/bios.c Thu Feb 24 09:19:10 1994
***************
*** 356,363 ****
long *place;
long old;
extern long save_dos, save_bios, save_xbios; /* in main.c */
extern int no_mem_prot; /* in main.c */
!
place = (long *)(((long)number) << 2);
if (number == 0x21) /* trap_1 */
old = save_dos;
--- 356,364 ----
long *place;
long old;
extern long save_dos, save_bios, save_xbios; /* in main.c */
+ #ifndef ONLY000
extern int no_mem_prot; /* in main.c */
! #endif
place = (long *)(((long)number) << 2);
if (number == 0x21) /* trap_1 */
old = save_dos;
***************
*** 401,406 ****
--- 402,408 ----
*place = mintcerr;
}
else {
+ #ifndef ONLY000
if (!no_mem_prot) {
/*
* if memory protection is on, the vector should be
***************
*** 414,419 ****
--- 416,422 ----
mark_region(r, PROT_S);
}
}
+ #endif
/* We would do just *place = vector except that
* someone else might be intercepting Setexc looking
* for something in particular...
diff -cr mint.org/context.spp mint.110/context.spp
*** mint.org/context.spp Tue Feb 1 03:28:18 1994
--- mint.110/context.spp Wed Mar 2 14:59:54 1994
***************
*** 52,77 ****
--- 52,83 ----
XREF _fpu
XREF _framesizes
XREF _new_trace ; from intr.s
+ %ifndef ONLY000
XREF _no_mem_prot
+ %endif
TEXT
_build_context:
move.l a0,-(sp) ; save a0; we'll use it for scratch
move.l 8(sp),a0 ; get address of save area
+ %ifndef ONLY000
tst.w _no_mem_prot ; is there memory protection?
bne.s noprot1
pmove crp,C_CRP(a0) ; save CRP from MMU
pmove tc,C_TC(a0) ; save TC from MMU
noprot1:
+ %endif
movem.l d0-d7/a0-a6,(a0) ; save registers D0-D7/A0-A6
clr.b C_PTRACE(a0) ; no pending traces, thanks!
lea 12(sp),a1 ; start of the interesting stack area
move.w (a1)+,d0 ; 68000 fake frame format
%ifndef ONLY030
+ %ifndef ONLY000
move.w ($59e).w,d7 ; get process frame flag
bne.s nojunk ; we have some junk on the stack
+ %endif
move.w d0,C_SFMT(a0) ; save fake frame format
subq.w #$8,d0 ; if bus error (note: subq is faster than
beq.s group0 ; cmp, and we won't need d0 later)
***************
*** 84,89 ****
--- 90,96 ----
move.w (a1)+,d0 ; get SR of context
move.w d0,C_SR(a0) ; save it
move.l (a1)+,C_PC(a0) ; save PC of context
+ %ifndef ONLY000
%ifndef ONLY030
tst.w d7 ; test longframe (AKP)
beq.s short1 ; short
***************
*** 108,113 ****
--- 115,121 ----
bcint: move.w (a1)+,(a2)+ ; copy CPU internal state
bcover: dbf d1,bcint
short1:
+ %endif
move.l a1,C_SSP(a0) ; a1 now points above the state frame
move.l usp,a1 ; save user stack pointer
move.l a1,C_USP(a0)
***************
*** 128,133 ****
--- 136,142 ----
move.l a0,-(sp) ; save a0
move.l 8(sp),a0 ; get address of context save area
+ %ifndef ONLY000
tst.w _no_mem_prot
bne.s noprot2
pmove crp,C_CRP(a0) ; save the CRP from the MMU
***************
*** 143,148 ****
--- 152,158 ----
fmovem.x fp0-fp7,C_FREGS(a0) ; save data registers
fmovem.l fpcr/fpsr/fpiar,C_FCTRL(a0) ; and control registers
nofpu2:
+ %endif
; note: I am somewhat unsure of this assumption, viz that save_context
; can never be called in a situation where a co-processor
; mid-instruction stack frame would be required. I suspect this is a
***************
*** 189,195 ****
; pmove C_CRP(a0),crp ; restore MMU root pointer
; pmove C_TC(a0),tc ; restore MMU control register
noprot3:
!
%ifndef ONLY030
tst.w ($59e).w ; test longframe (AKP)
beq.s short3
--- 199,205 ----
; pmove C_CRP(a0),crp ; restore MMU root pointer
; pmove C_TC(a0),tc ; restore MMU control register
noprot3:
! %ifndef ONLY000
%ifndef ONLY030
tst.w ($59e).w ; test longframe (AKP)
beq.s short3
***************
*** 214,220 ****
rcovernc:
move.w d0,-(sp) ; frame format identifier
; if running with a true coprocessor we need to restore the FPU state
-
tst.w _fpu ; is there a true FPU in the system
beq.s short3
tst.b C_FSTATE(a0) ; if NULL frame then the FPU is not in use
--- 224,229 ----
***************
*** 223,228 ****
--- 232,238 ----
fmovem.x C_FREGS(a0),fp0-fp7 ; and data registers
short4: frestore C_FSTATE(a0) ; finally the internal state
short3:
+ %endif
move.l C_PC(a0),-(sp) ; push the PC
move.w C_SR(a0),-(sp) ; push the status register
tst.b C_PTRACE(a0) ; check for a pending trace
***************
*** 250,255 ****
--- 260,266 ----
move.l C_TERM(a0),($408).w ; restore GEMDOS terminate vector
; Set memory context now
+ %ifndef ONLY000
tst.w _no_mem_prot
bne.s noprot4
pmove C_CRP(a0),crp ; restore MMU root pointer
***************
*** 278,284 ****
rcover2nc:
move.w d0,-(sp) ; frame format identifier
; if running with a true coprocessor we need to restore the FPU state
-
tst.w _fpu ; is there a true FPU in the system
beq.s short6
tst.b C_FSTATE(a0) ; if NULL frame then the FPU is not in use
--- 289,294 ----
***************
*** 287,292 ****
--- 297,303 ----
fmovem.x C_FREGS(a0),fp0-fp7 ; and data registers
short5: frestore C_FSTATE(a0) ; finally the internal state
short6:
+ %endif
move.l C_PC(a0),-(sp) ; push the PC
move.w C_SR(a0),-(sp) ; push status register
tst.b C_PTRACE(a0) ; check for a pending trace
diff -cr mint.org/cpu.spp mint.110/cpu.spp
*** mint.org/cpu.spp Tue Aug 17 01:29:36 1993
--- mint.110/cpu.spp Mon Feb 21 13:37:56 1994
***************
*** 8,13 ****
--- 8,14 ----
; The TC is four bytes at sp@(0xc). "Nulls" is here because we need to
; shove zeros into a few places.
;
+ %ifndef ONLY000
DATA
nulltc: dc.l 0
***************
*** 109,114 ****
--- 110,124 ----
noc: rts
;
+ ; PMMU stuff
+ ;
+ XDEF _flush_pmmu
+ _flush_pmmu:
+ pflusha
+ rts
+ END
+ %endif
+ ;
; Set the stack pointer to a new value
; Called when we're starting GEM from the exec_os vector
***************
*** 118,128 ****
move.l (sp)+,sp ; set stack pointer
jmp (a0) ; return
! ;
! ; PMMU stuff
! ;
! XDEF _flush_pmmu
! _flush_pmmu:
! pflusha
! rts
! END
--- 128,131 ----
move.l (sp)+,sp ; set stack pointer
jmp (a0) ; return
!
diff -cr mint.org/debug.c mint.110/debug.c
*** mint.org/debug.c Mon Sep 27 21:35:48 1993
--- mint.110/debug.c Mon Feb 21 14:43:44 1994
***************
*** 563,570 ****
--- 563,572 ----
if ( (r & 0x0ff) == 'x' ) {
extern int no_mem_prot;
close_filesys();
+ #ifndef ONLY000
if (!no_mem_prot)
restr_mmu();
+ #endif
restr_screen();
(void)Super((void *)tosssp); /* gratuitous (void *) for Lattice */
#ifdef PROFILING
***************
*** 624,629 ****
--- 626,632 ----
case 0x42: /* F8: dump log */
DUMPLOG();
break;
+ #ifndef ONLY000
case 0x43: /* F9: dump the global memory table */
QUICKDUMP();
break;
***************
*** 634,638 ****
--- 637,642 ----
BIG_MEM_DUMP(0,0);
break;
#endif
+ #endif
}
}
diff -cr mint.org/dosmem.c mint.110/dosmem.c
*** mint.org/dosmem.c Wed Feb 2 21:43:02 1994
--- mint.110/dosmem.c Thu Feb 24 09:49:18 1994
***************
*** 29,37 ****
--- 29,39 ----
m_addalt(start, size)
long start, size;
{
+ #ifndef ONLY000
extern int no_mem_prot; /* see main.c and memprot.c */
if (!no_mem_prot) return 0; /* pretend to succeed */
+ #endif
if (!add_region(alt, start, size, M_ALT))
return EINTRN;
else
***************
*** 506,512 ****
}
*newname = 0;
}
!
if (mkload || mkbase) {
/*
* Now that the file's loaded, flags is set to the prgflags
--- 508,514 ----
}
*newname = 0;
}
! #ifndef ONLY000
if (mkload || mkbase) {
/*
* Now that the file's loaded, flags is set to the prgflags
***************
*** 516,522 ****
*/
mark_region(env,(short)((flags & F_PROTMODE) >> F_PROTSHIFT));
}
!
if (p) {
/* free the PROC struct so fork_proc will succeed */
/* FIXME: it would be much better to pass the PROC as a parameter
--- 518,524 ----
*/
mark_region(env,(short)((flags & F_PROTMODE) >> F_PROTSHIFT));
}
! #endif
if (p) {
/* free the PROC struct so fork_proc will succeed */
/* FIXME: it would be much better to pass the PROC as a parameter
***************
*** 993,1003 ****
--- 995,1007 ----
*/
for (i = 0; i < curproc->num_reg; i++) {
m = curproc->mem[i];
+ #ifndef ONLY000
if (m && m->links == 1) { /* only the TSR is owner */
if (get_prot_mode(m) == PROT_P) {
mark_region(m, PROT_G);
}
}
+ #endif
}
return terminate(code, TSR_Q);
}
diff -cr mint.org/filesys.c mint.110/filesys.c
*** mint.org/filesys.c Wed Feb 2 21:43:44 1994
--- mint.110/filesys.c Wed Feb 23 10:39:32 1994
***************
*** 144,151 ****
int i;
extern struct kerinfo kernelinfo; /* in main.c */
char curpath[PATH_MAX];
MEMREGION *xfsreg;
!
curproc->dta = &dta;
d_getpath(curpath,0);
--- 144,152 ----
int i;
extern struct kerinfo kernelinfo; /* in main.c */
char curpath[PATH_MAX];
+ #ifndef ONLY000
MEMREGION *xfsreg;
! #endif
curproc->dta = &dta;
d_getpath(curpath,0);
***************
*** 179,187 ****
if (fs) {
TRACE(("%s loaded OK", dta.dta_name));
/* put the loaded XFS into super accesible memory */
xfsreg = addr2region( (long) b );
mark_region(xfsreg, PROT_S);
!
/* link it into the list of drivers */
/* uk: but only if it has not installed itself via Dcntl()
* after checking if file system is already installed,
--- 180,189 ----
if (fs) {
TRACE(("%s loaded OK", dta.dta_name));
/* put the loaded XFS into super accesible memory */
+ #ifndef ONLY000
xfsreg = addr2region( (long) b );
mark_region(xfsreg, PROT_S);
! #endif
/* link it into the list of drivers */
/* uk: but only if it has not installed itself via Dcntl()
* after checking if file system is already installed,
***************
*** 259,266 ****
char curpath[PATH_MAX];
char dev_name[PATH_MAX]; /* a bit long, but one never knows... */
char ch, *p;
MEMREGION *xddreg;
!
curproc->dta = &dta;
d_getpath(curpath,0);
--- 261,269 ----
char curpath[PATH_MAX];
char dev_name[PATH_MAX]; /* a bit long, but one never knows... */
char ch, *p;
+ #ifndef ONLY000
MEMREGION *xddreg;
! #endif
curproc->dta = &dta;
d_getpath(curpath,0);
***************
*** 321,328 ****
--- 324,333 ----
}
TRACE(("%s loaded OK", dta.dta_name));
/* put the loaded XDD into super accesible memory */
+ #ifndef ONLY000
xddreg = addr2region( (long) b );
mark_region(xddreg, PROT_S);
+ #endif
} else {
DEBUG(("%s returned null", dta.dta_name));
m_free((virtaddr)b);
diff -cr mint.org/intr.spp mint.110/intr.spp
*** mint.org/intr.spp Wed Feb 2 16:52:32 1994
--- mint.110/intr.spp Wed Mar 2 15:09:54 1994
***************
*** 64,75 ****
--- 64,77 ----
XREF _keyrec
_mint_vbl:
+ %ifndef ONLY000
%ifndef ONLY030
tst.w ($59e).w ; test longframe (AKP)
beq.s L_short1
%endif
clr.w -(sp) ; yes, long frames: push a frame word
L_short1:
+ %endif
pea L_comeback ; push fake PC
move.w sr,-(sp) ; push status register
move.l _old_vbl+8,-(sp) ; go service the interrupt
***************
*** 315,322 ****
--- 317,326 ----
move.l _curproc,a0
move.l P_EXCSSP(a0),a1
lea $10(a1),a1 ; point to access address
+ %ifndef ONLY000
tst.w ($59e).w ; test longframe
beq.s NOMMU1
+ %endif
addq.w #8,a1 ; on 68000, address is 8 bytes further
NOMMU1:
move.l (a1),P_EXCADDR(a0) ; save the access address
diff -cr mint.org/main.c mint.110/main.c
*** mint.org/main.c Fri Feb 11 18:37:16 1994
--- mint.110/main.c Thu Feb 24 08:56:18 1994
***************
*** 576,582 ****
--- 576,584 ----
long *sysbase;
long r;
extern int debug_level, debug_logging; /* in debug.c */
+ #ifndef ONLY000
extern int no_mem_prot; /* memprot.c */
+ #endif
extern const char *greet1, *greet2;
/* welcome.c */
static char buf[SPRINTF_MAX];
***************
*** 647,661 ****
--- 649,667 ----
int givenotice = (argv[0][2] != 'w');
/* -m and -p turn off memory protection */
extern const char *memprot_notice, *memprot_warning;
+ #ifndef ONLY000
if (no_mem_prot) {
+ #endif
if (givenotice)
Cconws(memprot_notice);
+ #ifndef ONLY000
}
else {
no_mem_prot = 1;
if (givenotice)
Cconws(memprot_warning);
}
+ #endif
}
else if (argv[0][1] == 'l') {
/* -l turns on debug logging */
***************
*** 691,697 ****
(void)Crawcin();
Cconws("\r\033K");
}
!
#ifdef notdef
/* if less than 1 megabyte free, turn off memory protection */
if (Mxalloc(-1L, 3) < ONE_MEG && !no_mem_prot) {
--- 697,703 ----
(void)Crawcin();
Cconws("\r\033K");
}
! #ifndef ONLY000
#ifdef notdef
/* if less than 1 megabyte free, turn off memory protection */
if (Mxalloc(-1L, 3) < ONE_MEG && !no_mem_prot) {
***************
*** 706,711 ****
--- 712,718 ----
*/
if (!no_mem_prot && Fsfirst("\\AUTO\\MINTNP.PRG",0) == 0)
no_mem_prot = 1;
+ #endif
/* check for GEM -- this must be done from user mode */
gem_active = check_for_gem();
***************
*** 721,729 ****
curpath[1] = 0;
}
tosssp = (long)Super(0L); /* enter supervisor mode */
if (!no_mem_prot)
save_mmu(); /* save current MMU setup */
!
/* get GEMDOS pointer to current basepage */
/* 0x4f2 points to the base of the OS; here we can find the OS compilation
date, and (in newer versions of TOS) where the current basepage pointer
--- 728,737 ----
curpath[1] = 0;
}
tosssp = (long)Super(0L); /* enter supervisor mode */
+ #ifndef ONLY000
if (!no_mem_prot)
save_mmu(); /* save current MMU setup */
! #endif
/* get GEMDOS pointer to current basepage */
/* 0x4f2 points to the base of the OS; here we can find the OS compilation
date, and (in newer versions of TOS) where the current basepage pointer
***************
*** 929,936 ****
--- 937,946 ----
}
restr_intr();
close_filesys();
+ #ifndef ONLY000
if (!no_mem_prot)
restr_mmu();
+ #endif
restr_screen();
(void)Super((void *)tosssp); /* gratuitous (void *) for Lattice */
***************
*** 1014,1025 ****
--- 1024,1038 ----
i++;
}
+ #ifndef ONLY000
+
/* jr: install PMMU cookie if memory protection is used */
if (!no_mem_prot) {
strncpy(newcookie[i].tag.aschar, "PMMU", 4);
newcookie[i].value = 0;
i++;
}
+ #endif
/* the last cookie should have a 0 tag, and a value indicating the number
* of slots, total
***************
*** 1050,1057 ****
int foundcpu = 0;
int i;
long *sysbase;
extern int no_mem_prot;
!
mcpu = 0;
jar = *CJAR; /* CJAR defined in cookie.h */
if (jar) {
--- 1063,1071 ----
int foundcpu = 0;
int i;
long *sysbase;
+ #ifndef ONLY000
extern int no_mem_prot;
! #endif
mcpu = 0;
jar = *CJAR; /* CJAR defined in cookie.h */
if (jar) {
***************
*** 1062,1068 ****
--- 1076,1084 ----
} else if (!strncmp(jar->tag.aschar, "_CPU",4)) {
/* if not '030 then no memory protection */
mcpu = jar->value;
+ #ifndef ONLY000
if (jar->value != 30) no_mem_prot = 1;
+ #endif
foundcpu = 1;
} else if (!strncmp(jar->tag.aschar, "_VDO",4)) {
FalconVideo = (jar->value == 0x00030000L);
***************
*** 1077,1088 ****
--- 1093,1108 ----
/* jr: if PMMU cookie exists, someone else is
already using the PMMU */
Cconws ("MiNT: PMMU already in use, memory protection turned off.\r\n");
+ #ifndef ONLY000
no_mem_prot = 1;
+ #endif
}
jar++;
}
}
+ #ifndef ONLY000
if (!foundcpu) no_mem_prot = 1;
+ #endif
/*
* if no preference found, look at the country code to decide
*/
diff -cr mint.org/makefile mint.110/makefile
*** mint.org/makefile Tue Mar 1 10:59:04 1994
--- mint.110/makefile Thu Feb 24 18:52:10 1994
***************
*** 36,41 ****
--- 36,42 ----
AS = gcc
MODEL = -mshort
MODEL030 = -mshort -m68020
+ MODEL000 = -mshort
LIBS = -liio16
# add -DMULTITOS for a MultiTOS kernel
***************
*** 45,50 ****
--- 46,52 ----
DEFS = #-DMULTITOS -DDEBUG_INFO
#DEFS030 = -DMULTITOS -DONLY030
DEFS030 = -DONLY030
+ DEFS000 = -DONLY000
#
# if you have an older version of gcc, it won't understand -G;
***************
*** 55,72 ****
CFLAGS = -G -Wall -O2 -fomit-frame-pointer $(MODEL) $(DEFS)
ASFLAGS = $(MODEL)
CFLAGS030 = -G -Wall -O2 -fomit-frame-pointer $(MODEL030) $(DEFS030)
! ASFLAGS030 = $(MODEL030)
! COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \
! filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \
! biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
! unifs.o shmfs.o fasttext.o welcome.o nalloc2.o memprot.o realloc.o
COBJS030 = bios.o0 xbios.o0 console.o0 dos.o0 dosdir.o0 dosfile.o0 dosmem.o0 dossig.o0 \
filesys.o0 main.o0 mem.o0 proc.o0 signal.o0 timeout.o0 tty.o0 util.o0 \
biosfs.o0 pipefs.o0 procfs.o0 tosfs.o0 debug.o0 rendez.o0 \
unifs.o0 shmfs.o0 fasttext.o0 welcome.o0 nalloc2.o0 memprot.o realloc.o0
CFILES = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
--- 57,83 ----
CFLAGS = -G -Wall -O2 -fomit-frame-pointer $(MODEL) $(DEFS)
ASFLAGS = $(MODEL)
CFLAGS030 = -G -Wall -O2 -fomit-frame-pointer $(MODEL030) $(DEFS030)
! ASFLAGS0 = $(MODEL030)
! CFLAGS000 = -G -Wall -O2 -fomit-frame-pointer $(MODEL000) $(DEFS000)
! ASFLAGS00 = $(MODEL000)
!
! COMMONOBJS = console.o dos.o dosdir.o dosfile.o dossig.o \
! timeout.o tty.o util.o \
! biosfs.o pipefs.o tosfs.o rendez.o \
! unifs.o fasttext.o welcome.o nalloc2.o
! COBJS = $(COMMONOBJS) bios.o xbios.o dosmem.o filesys.o main.o mem.o proc.o signal.o procfs.o debug.o \
! memprot.o shmfs.o realloc.o
COBJS030 = bios.o0 xbios.o0 console.o0 dos.o0 dosdir.o0 dosfile.o0 dosmem.o0 dossig.o0 \
filesys.o0 main.o0 mem.o0 proc.o0 signal.o0 timeout.o0 tty.o0 util.o0 \
biosfs.o0 pipefs.o0 procfs.o0 tosfs.o0 debug.o0 rendez.o0 \
unifs.o0 shmfs.o0 fasttext.o0 welcome.o0 nalloc2.o0 memprot.o realloc.o0
+ COBJS000 = $(COMMONOBJS) bios.o00 xbios.o00 dosmem.o00 filesys.o00 main.o00 mem.o00 proc.o00 signal.o00 \
+ procfs.o00 debug.o00 shmfs.o00 realloc.o00
+
+
CFILES = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
***************
*** 81,91 ****
SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
SOBJS030 = context.o0 intr.o0 syscall.o0 quickzer.o0 quickmov.o0 cpu.o0
OBJS = $(COBJS) $(SOBJS)
OBJS030 = $(COBJS030) $(SOBJS030)
! #all: mint.prg mint030.prg
mint.prg: $(OBJS)
$(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
--- 92,104 ----
SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
SOBJS030 = context.o0 intr.o0 syscall.o0 quickzer.o0 quickmov.o0 cpu.o0
+ SOBJS000 = context.o00 intr.o00 syscall.o00 quickzer.o00 quickmov.o00 cpu.o00
OBJS = $(COBJS) $(SOBJS)
OBJS030 = $(COBJS030) $(SOBJS030)
+ OBJS000 = $(COBJS000) $(SOBJS000)
! all: mint.prg mint030.prg mint000.prg
mint.prg: $(OBJS)
$(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
***************
*** 95,100 ****
--- 108,117 ----
$(CC) $(CFLAGS030) -o mint030.prg $(OBJS030) $(LIBS)
# strip mint030.prg
+ mint000.prg: $(OBJS000)
+ $(CC) $(CFLAGS000) -o mint000.prg $(OBJS000) $(LIBS)
+ # strip mint000.prg
+
$(SOBJS): proc.h
$(COBJS): mint.h proc.h file.h
***************
*** 178,184 ****
#
# assembler source files
#
! .SUFFIXES: .spp .o0
.spp.o:
$(ATRANS) $(DEFS) -gas -o $*.s $<
--- 195,201 ----
#
# assembler source files
#
! .SUFFIXES: .spp .o0 .o00
.spp.o:
$(ATRANS) $(DEFS) -gas -o $*.s $<
***************
*** 188,195 ****
--- 205,218 ----
$(ATRANS) $(DEFS030) -gas -o $*.s $<
$(AS) $(ASFLAGS0) -o $@ -c $*.s
$(RM) $*.s
+ .spp.o00:
+ $(ATRANS) $(DEFS000) -gas -o $*.s $<
+ $(AS) $(ASFLAGS00) -o $@ -c $*.s
+ $(RM) $*.s
.c.o0:
$(CC) $(CFLAGS030) -o $@ -c $<
+ .c.o00:
+ $(CC) $(CFLAGS000) -o $@ -c $<
context.o: context.spp magic.i $(ATRANS)
intr.o: intr.spp magic.i $(ATRANS)
***************
*** 205,210 ****
--- 228,240 ----
quickmov.o0: quickmov.spp $(ATRANS)
cpu.o0: cpu.spp $(ATRANS)
+ context.o00: context.spp magic.i $(ATRANS)
+ intr.o00: intr.spp magic.i $(ATRANS)
+ syscall.o00: syscall.spp magic.i $(ATRANS)
+ quickzer.o00: quickzer.spp $(ATRANS)
+ quickmov.o00: quickmov.spp $(ATRANS)
+ cpu.o00: cpu.spp $(ATRANS)
+
#
# mkptypes generates prototypes from C source code. If you don't have it,
# you'll have to add/delete function prototypes by hand.
***************
*** 219,225 ****
#
# macros for cleaning up
#
! GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
EXTRAS= asmtab.c asmtab.h mint.prg
clean:
--- 249,255 ----
#
# macros for cleaning up
#
! GENFILES= $(OBJS) $(OBJS030) $(OBJS000) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
EXTRAS= asmtab.c asmtab.h mint.prg
clean:
diff -cr mint.org/mem.c mint.110/mem.c
*** mint.org/mem.c Tue Feb 1 03:31:44 1994
--- mint.110/mem.c Thu Feb 24 10:01:06 1994
***************
*** 68,73 ****
--- 68,74 ----
init_core();
init_swap();
+ #ifndef ONLY000
init_tables(); /* initialize MMU constants */
/* mark all the regions in the core & alt lists as "invalid" */
***************
*** 77,82 ****
--- 78,84 ----
for (r = *alt; r; r = r->next) {
mark_region(r,PROT_I);
}
+ #endif
/* make sure the screen is set up properly */
newbase = s_realloc(scrnsize);
***************
*** 430,436 ****
--- 432,440 ----
return EACCDN;
found:
+ #ifndef ONLY000
mark_region(*mr,newmode);
+ #endif
return E_OK;
}
***************
*** 466,472 ****
--- 470,478 ----
reg->links++;
proc->mem[i] = reg;
proc->addr[i] = (virtaddr) reg->loc;
+ #ifndef ONLY000
mark_proc_region(proc,reg,PROT_P);
+ #endif
return proc->addr[i];
}
}
***************
*** 543,552 ****
--- 549,560 ----
if (reg->links == 0) {
free_region(reg);
}
+ #ifndef ONLY000
else {
/* cause curproc's table to be updated */
mark_proc_region(proc,reg,PROT_I);
}
+ #endif
return;
}
}
***************
*** 628,634 ****
--- 636,644 ----
return NULL;
win:
+ #ifndef ONLY000
mark_region(n, mode & PROT_PROTMODE);
+ #endif
if (mode & M_KEEP) n->mflags |= M_KEEP;
return n;
***************
*** 698,707 ****
m = *map;
assert(m);
/* MEMPROT: invalidate */
if (map == core || map == alt)
mark_region(reg,PROT_I);
!
if (m == reg) goto merge_after;
/* merge previous region if it's free and contiguous with 'reg' */
--- 708,718 ----
m = *map;
assert(m);
+ #ifndef ONLY000
/* MEMPROT: invalidate */
if (map == core || map == alt)
mark_region(reg,PROT_I);
! #endif
if (m == reg) goto merge_after;
/* merge previous region if it's free and contiguous with 'reg' */
***************
*** 790,797 ****
n->len += diff;
/* MEMPROT: invalidate the second half */
/* (part of it is already invalid; that's OK) */
mark_region(n,PROT_I);
!
return 0;
}
else {
--- 801,809 ----
n->len += diff;
/* MEMPROT: invalidate the second half */
/* (part of it is already invalid; that's OK) */
+ #ifndef ONLY000
mark_region(n,PROT_I);
! #endif
return 0;
}
else {
***************
*** 806,813 ****
--- 818,827 ----
n->mflags = reg->mflags & M_MAP;
n->next = reg->next;
reg->next = n;
+ #ifndef ONLY000
/* MEMPROT: invalidate the new, free region */
mark_region(n,PROT_I);
+ #endif
}
return 0;
}
***************
*** 1398,1406 ****
TRACE(("exec_region"));
b = (BASEPAGE *) mem->loc;
!
cpush((void *)b->p_tbase, b->p_tlen); /* flush cached versions of the text */
!
/* set some (undocumented) variables in the basepage */
b->p_defdrv = p->curdrv;
for (i = 0; i < 6; i++)
--- 1412,1420 ----
TRACE(("exec_region"));
b = (BASEPAGE *) mem->loc;
! #ifndef ONLY000
cpush((void *)b->p_tbase, b->p_tlen); /* flush cached versions of the text */
! #endif
/* set some (undocumented) variables in the basepage */
b->p_defdrv = p->curdrv;
for (i = 0; i < 6; i++)
***************
*** 1612,1617 ****
--- 1626,1632 ----
return 0;
}
+ #ifndef ONLY000
/*
* convert an address to a memory region; this works only in
* the ST RAM and TT RAM maps, and will fail for memory that
***************
*** 1642,1648 ****
}
return 0;
}
!
/*
* some debugging stuff
*/
--- 1657,1663 ----
}
return 0;
}
! #endif
/*
* some debugging stuff
*/
diff -cr mint.org/mem.h mint.110/mem.h
*** mint.org/mem.h Wed Feb 2 17:03:06 1994
--- mint.110/mem.h Wed Feb 23 09:41:54 1994
***************
*** 140,149 ****
--- 140,157 ----
* STes, TTs, and Falcons). We actually set a variable in main.c
* that holds the screen boundary stuff.
*/
+ #ifndef ONLY000
extern int no_mem_prot;
+ #endif
+
extern int screen_boundary;
+ #ifndef ONLY000
#define MASKBITS (no_mem_prot ? screen_boundary : (QUANTUM-1))
+ #else
+ #define MASKBITS screen_boundary
+ #endif
+
#define ROUND(size) ((size + MASKBITS) & ~MASKBITS)
/* interesting memory constants */
diff -cr mint.org/proc.c mint.110/proc.c
*** mint.org/proc.c Fri Feb 11 21:34:08 1994
--- mint.110/proc.c Thu Feb 24 08:51:18 1994
***************
*** 45,50 ****
--- 45,53 ----
PROC *p;
void *pt;
+ #ifdef ONLY000
+ long page_table_size = 0;
+ #endif
pt = kmalloc(page_table_size + 16);
if (!pt) return 0;
***************
*** 174,181 ****
}
/* now that memory ownership is copied, fill in page table */
init_page_table(p);
!
/* child isn't traced */
p->ptracer = 0;
p->ptraceflags = 0;
--- 177,185 ----
}
/* now that memory ownership is copied, fill in page table */
+ #ifndef ONLY000
init_page_table(p);
! #endif
/* child isn't traced */
p->ptracer = 0;
p->ptraceflags = 0;
***************
*** 246,254 ****
curproc->root[i].dev = curproc->curdir[i].dev = i;
}
}
!
init_page_table(curproc);
!
/* Set the correct drive. The current directory we
* set later, after all file systems have been loaded.
*/
--- 250,258 ----
curproc->root[i].dev = curproc->curdir[i].dev = i;
}
}
! #ifndef ONLY000
init_page_table(curproc);
! #endif
/* Set the correct drive. The current directory we
* set later, after all file systems have been loaded.
*/
diff -cr mint.org/procfs.c mint.110/procfs.c
*** mint.org/procfs.c Tue Feb 15 22:23:34 1994
--- mint.110/procfs.c Wed Feb 23 09:51:20 1994
***************
*** 473,478 ****
--- 473,479 ----
TRACE(("proc_write to pid %d: %ld bytes to %lx", p->pid, nbytes, where));
+ #ifndef ONLY000
prot_hold = mem_access_for(p, (ulong)where,nbytes);
if (prot_hold == 0) {
DEBUG(("Can't Fwrite that memory: not all the same or not owner."));
***************
*** 482,496 ****
DEBUG(("Attempt to Fwrite memory crossing a managed boundary"));
return EACCDN;
}
!
bytes_written = nbytes;
while (nbytes-- > 0) {
*where++ = *buf++;
}
cpush((void *)f->pos, bytes_written); /* flush cached data */
-
/* MEMPROT: done with temp mapping (only call if temp'ed above) */
if (prot_hold != -1) prot_temp((ulong)f->pos,bytes_written,prot_hold);
f->pos += bytes_written;
return bytes_written;
--- 483,498 ----
DEBUG(("Attempt to Fwrite memory crossing a managed boundary"));
return EACCDN;
}
! #endif
bytes_written = nbytes;
while (nbytes-- > 0) {
*where++ = *buf++;
}
+ #ifndef ONLY000
cpush((void *)f->pos, bytes_written); /* flush cached data */
/* MEMPROT: done with temp mapping (only call if temp'ed above) */
if (prot_hold != -1) prot_temp((ulong)f->pos,bytes_written,prot_hold);
+ #endif
f->pos += bytes_written;
return bytes_written;
***************
*** 509,514 ****
--- 511,517 ----
TRACE(("proc_read from pid %d: %ld bytes from %lx", p->pid, nbytes, where));
+ #ifndef ONLY000
prot_hold = mem_access_for(p, (ulong)where,nbytes);
if (prot_hold == 0) {
DEBUG(("Can't Fread that memory: not all the same."));
***************
*** 518,531 ****
DEBUG(("Attempt to Fread memory crossing a managed boundary"));
return EACCDN;
}
bytes_read = nbytes;
while (nbytes-- > 0) {
*buf++ = *where++;
}
!
/* MEMPROT: done with temp mapping (only call if temp'ed above) */
if (prot_hold != -1) prot_temp((ulong)f->pos,bytes_read,prot_hold);
f->pos += bytes_read;
return bytes_read;
--- 521,536 ----
DEBUG(("Attempt to Fread memory crossing a managed boundary"));
return EACCDN;
}
+ #endif
bytes_read = nbytes;
while (nbytes-- > 0) {
*buf++ = *where++;
}
! #ifndef ONLY000
/* MEMPROT: done with temp mapping (only call if temp'ed above) */
if (prot_hold != -1) prot_temp((ulong)f->pos,bytes_read,prot_hold);
+ #endif
f->pos += bytes_read;
return bytes_read;
***************
*** 586,592 ****
--- 591,600 ----
/* you're making the process OS_SPECIAL */
TRACE(("Fcntl OS_SPECIAL pid %d",p->pid));
p->memflags = newflags;
+ #ifndef ONLY000
mem_prot_special(p);
+ #endif
+
}
/* note: only the low 16 bits are actually used */
p->memflags = *((long *)buf);
diff -cr mint.org/realloc.c mint.110/realloc.c
*** mint.org/realloc.c Tue Aug 17 01:33:16 1993
--- mint.110/realloc.c Wed Mar 2 14:22:22 1994
***************
*** 78,84 ****
--- 78,86 ----
if (lastfit->len == newsize) {
if (newm) dispose_region(newm);
lastfit->links++;
+ #ifndef ONLY000
mark_region(lastfit, PROT_G);
+ #endif
return (long)lastfit;
}
if (!newm) return 0; /* can't get a new region */
***************
*** 92,98 ****
--- 94,102 ----
newm->links++;
newm->next = lastfit->next;
lastfit->next = newm;
+ #ifndef ONLY000
mark_region(newm, PROT_G);
+ #endif
return (long)newm;
}
***************
*** 125,132 ****
--- 129,138 ----
prevptr->len += oldsize - newsize;
reg->loc += oldsize - newsize;
reg->len -= oldsize - newsize;
+ #ifndef ONLY000
mark_region(prevptr, PROT_I);
mark_region(reg, PROT_G);
+ #endif
return reg->loc;
}
***************
*** 154,161 ****
--- 160,169 ----
else
*map = m;
m->next = reg;
+ #ifndef ONLY000
mark_region(m, PROT_I);
mark_region(reg, PROT_G);
+ #endif
return reg->loc;
}
***************
*** 192,198 ****
--- 200,208 ----
reg->len += foo->len;
reg->next = foo->next;
dispose_region(foo);
+ #ifndef ONLY000
mark_region(reg, PROT_G);
+ #endif
if (reg->len >= newsize)
return reg->loc;
oldsize = reg->len;
***************
*** 220,226 ****
--- 230,238 ----
}
dispose_region(prevptr);
}
+ #ifndef ONLY000
mark_region(reg, PROT_G);
+ #endif
}
/* finally! we return the new starting address of "our" region */
diff -cr mint.org/signal.c mint.110/signal.c
*** mint.org/signal.c Wed Feb 9 22:10:02 1994
--- mint.110/signal.c Wed Feb 23 11:23:16 1994
***************
*** 207,225 ****
long *procinfo = (long *)0x380L;
int i;
CONTEXT *crash;
extern int no_mem_prot;
!
if (sig < 0 || sig > 31) {
ALERT("bombs(%d): sig out of range", sig);
}
else if (signames[sig]) {
if (!no_mem_prot && sig == SIGBUS) {
/* already reported by report_buserr */
} else {
ALERT("%s: User PC=%lx (basepage=%lx)",
signames[sig],
curproc->exception_pc, curproc->base);
}
/* save the processor state at crash time */
/* assumes that "crash time" is the context curproc->ctxt[SYSCALL] */
/* BUG: this is not true if the crash happened in the kernel; in the
--- 207,230 ----
long *procinfo = (long *)0x380L;
int i;
CONTEXT *crash;
+ #ifndef ONLY000
extern int no_mem_prot;
! #endif
if (sig < 0 || sig > 31) {
ALERT("bombs(%d): sig out of range", sig);
}
else if (signames[sig]) {
+ #ifndef ONLY000
if (!no_mem_prot && sig == SIGBUS) {
/* already reported by report_buserr */
} else {
+ #endif
ALERT("%s: User PC=%lx (basepage=%lx)",
signames[sig],
curproc->exception_pc, curproc->base);
+ #ifndef ONLY000
}
+ #endif
/* save the processor state at crash time */
/* assumes that "crash time" is the context curproc->ctxt[SYSCALL] */
/* BUG: this is not true if the crash happened in the kernel; in the
***************
*** 563,570 ****
--- 568,577 ----
void
sigbus()
{
+ #ifndef ONLY000
if (curproc->sighandle[SIGBUS] == SIG_DFL)
report_buserr();
+ #endif
exception(SIGBUS);
}
diff -cr mint.org/syscall.spp mint.110/syscall.spp
*** mint.org/syscall.spp Fri Feb 11 18:23:02 1994
--- mint.110/syscall.spp Wed Mar 2 15:04:26 1994
***************
*** 109,118 ****
--- 109,120 ----
lea 8(sp),a1
%else
lea 6(sp),a1 ; supervisor mode: args on stack
+ %ifndef ONLY000
tst.w ($59e).w ; test longframe
beq.s LX_check
addq.w #2,a1 ; stack is a bit bigger
%endif
+ %endif
bra.s LX_check
LX_usr:
move.l usp,a1 ; user mode: args on user stack
diff -cr mint.org/xbios.c mint.110/xbios.c
*** mint.org/xbios.c Thu Sep 9 02:02:36 1993
--- mint.110/xbios.c Thu Feb 24 09:21:42 1994
***************
*** 264,269 ****
--- 264,271 ----
dosound(ptr)
const char *ptr;
{
+ #ifndef ONLY000
+
MEMREGION *r;
if (!no_mem_prot && ((long)ptr >= 0)) {
***************
*** 286,292 ****
mark_region(r, PROT_S);
}
}
!
return call_dosound(ptr);
}
--- 288,294 ----
mark_region(r, PROT_S);
}
}
! #endif
return call_dosound(ptr);
}