diff -ru _/minix/src/arch/ppc/aconst.h minix/src/arch/ppc/aconst.h --- _/minix/src/arch/ppc/aconst.h 2006-09-10 00:26:24.000000000 +0900 +++ minix/src/arch/ppc/aconst.h 2010-06-11 00:00:00.000000000 +0900 @@ -43,8 +43,13 @@ * note, kinfo.base is the physical load address of * the kernel data segment. */ +#if 0 #define vir2phys(vir) (kinfo.data_base + ((vir_bytes)(vir) - EA_SEGMENT1)) #define phys2vir(phys) (((phys_bytes)(phys) - kinfo.data_base) + EA_SEGMENT1) +#else /* patch */ +#define vir2phys(vir) ((phys_bytes)(vir)) +#define phys2vir(phys) ((vir_bytes)(phys)) +#endif /* PPC memory units */ #define CLICK_SIZE 4096 /* unit in which memory is allocated */ @@ -80,7 +85,11 @@ * The setup of the (OpenPIC) timer(0) interrupt is done at the arch/ppc/clock.c file. * */ +#if 0 #define CLOCK_IRQ 63 /* note, this is not the default (make sure it's not in use). */ +#else /* patch */ +#define CLOCK_IRQ 4 +#endif #define CLOCK_TICKS_PER_SEC 60 /* # of ticks the clock makes per second, Minix wants 60 */ /* The default timebase frequency for the PPC (should check this via OF) @@ -117,7 +126,17 @@ */ #ifndef KERNEL_PSW #include "cpu/cpu.h" /* need the bit masks */ +#if 0 #define KERNEL_PSW ( MSR_FP | MSR_ME | MSR_IR | MSR_DR | MSR_RI ) +#else /* patch */ +#if defined(__arm__) + #define KERNEL_PSW ( 0x5f ) /* I = 0, F = 1, M = 0x1f */ +#elif defined(__mips__) + #define KERNEL_PSW ( 0x01 ) /* KSU = 0, IE = 1 */ +#else +#error KERNEL_PSW +#endif +#endif #endif #ifndef INIT_TASK_PSW @@ -125,7 +144,17 @@ /* Same as the kernel PSW but with external exceptions enabled. */ +#if 0 #define INIT_TASK_PSW ( KERNEL_PSW | MSR_EE ) +#else /* patch */ +#if defined(__arm__) + #define INIT_TASK_PSW ( 0x5f ) /* I = 0, F = 1, M = 0x1f */ +#elif defined(__mips__) + #define INIT_TASK_PSW ( 0x01 ) /* KSU = 0, IE = 1 */ +#else +#error INIT_TASK_PSW +#endif +#endif #endif #ifndef INIT_USER_PSW @@ -133,7 +162,17 @@ /* Same as the task PSW but with the user flag enabled. */ +#if 0 #define INIT_USER_PSW ( INIT_TASK_PSW | MSR_PR ) +#else /* patch */ +#if defined(__arm__) + #define INIT_USER_PSW ( 0x50 ) /* I = 0, F = 1, M = 0x10 */ +#elif defined(__mips__) + #define INIT_USER_PSW ( 0x11 ) /* KSU = 2, IE = 1 */ +#else +#error INIT_USER_PSW +#endif +#endif #endif #endif /* #ifdef __KERNEL__ */ diff -ru _/minix/src/arch/ppc/asm.h minix/src/arch/ppc/asm.h --- _/minix/src/arch/ppc/asm.h 2006-08-13 01:39:40.000000000 +0900 +++ minix/src/arch/ppc/asm.h 2010-06-11 00:00:00.000000000 +0900 @@ -13,19 +13,55 @@ /* Define a global function label, */ +#if 0 #define _GLOBAL_F(f) \ .align 2; \ .globl f; \ .type f, @function; \ f: +#else /* patch */ +#if defined(__arm__) +#define _GLOBAL_F(f) \ + .align 2; \ + .globl f; \ + .type f, %function; \ +f: +#elif defined(__mips__) +#define _GLOBAL_F(f) \ + .align 2; \ + .globl f; \ + .type f, @function; \ +f: +#else +#error _GLOBAL_F +#endif +#endif /* Define a global object label (at .data or .bss). */ +#if 0 +#define _GLOBAL_O(o) \ + .align 2; \ + .globl o; \ + .type o, @object; \ +o: +#else /* patch */ +#if defined(__arm__) +#define _GLOBAL_O(o) \ + .align 2; \ + .globl o; \ + .type o, %object; \ +o: +#elif defined(__mips__) #define _GLOBAL_O(o) \ .align 2; \ .globl o; \ .type o, @object; \ o: +#else +#error _GLOBAL_O +#endif +#endif /* Define a object to the bss section. diff -ru _/minix/src/arch/ppc/atypes.h minix/src/arch/ppc/atypes.h --- _/minix/src/arch/ppc/atypes.h 2006-08-14 21:48:56.000000000 +0900 +++ minix/src/arch/ppc/atypes.h 2010-06-11 00:00:00.000000000 +0900 @@ -55,6 +55,7 @@ #include "aconst.h" /* NR_SEGR */ typedef struct stackframe_s { /* proc_ptr points here */ +#if 0 /* User registers. */ reg_t fp; /* gpr0, first gpr (not very sure though if it's used as frame pointer, I am using -fomit-frame-pointer :) )*/ reg_t sp; /* gpr1, second gpr, following the ABI this is used as stack pointer. */ @@ -72,6 +73,63 @@ /* Floating point registers. */ fp_reg_t fpr[NR_FPR]; +#else /* patch */ +#if defined(__arm__) + reg_t retreg; + reg_t r1; + reg_t r2; + reg_t r3; + reg_t r4; + reg_t r5; + reg_t r6; + reg_t r7; + reg_t r8; + reg_t r9; + reg_t r10; + reg_t fp; + reg_t r12; + reg_t sp; + reg_t lr; + reg_t pc; + reg_t psw; +#elif defined(__mips__) + reg_t pc; + reg_t gpr1; + reg_t retreg; + reg_t gpr3; + reg_t gpr4; + reg_t gpr5; + reg_t gpr6; + reg_t gpr7; + reg_t gpr8; + reg_t gpr9; + reg_t gpr10; + reg_t gpr11; + reg_t gpr12; + reg_t gpr13; + reg_t gpr14; + reg_t gpr15; + reg_t gpr16; + reg_t gpr17; + reg_t gpr18; + reg_t gpr19; + reg_t gpr20; + reg_t gpr21; + reg_t gpr22; + reg_t gpr23; + reg_t gpr24; + reg_t gpr25; + reg_t hi; + reg_t lo; + reg_t gpr28; + reg_t sp; + reg_t fp; + reg_t lr; + reg_t psw; +#else +#error stackframe_t +#endif +#endif } stackframe_t; /* The PowerPC chip has 16 segment registers from which a running program diff -ru _/minix/src/commands/ash/Makefile minix/src/commands/ash/Makefile --- _/minix/src/commands/ash/Makefile 2006-09-24 20:38:48.000000000 +0900 +++ minix/src/commands/ash/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -25,14 +25,21 @@ $(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I. -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I. -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I. -I$(MINIX_SOURCE)/arch/ppc +#CFLAGS := -DSHELL -D_MINIX -D_POSIX_SOURCE \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs \ +# -ffreestanding -mno-sdata -fno-builtin -mno-altivec CFLAGS := -DSHELL -D_MINIX -D_POSIX_SOURCE \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs \ - -ffreestanding -mno-sdata -fno-builtin -mno-altivec + -Wall -Wstrict-prototypes \ + -Wno-trigraphs \ + -ffreestanding # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(UTIL) @@ -41,9 +48,10 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(UTIL): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 100k elf32/$@ aout/$@ - @cp -v aout/$@ $(MINIX_FS)/bin/$@ +# @cp -v aout/$@ $(MINIX_FS)/bin/$@ # clean up local files .PHONY: clean diff -ru _/minix/src/drivers/arch/ppc/at_wini/Makefile minix/src/drivers/arch/ppc/at_wini/Makefile --- _/minix/src/drivers/arch/ppc/at_wini/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/arch/ppc/at_wini/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -23,21 +23,29 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a -STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ - $(MINIX_SOURCE)/stdlib/libgcc.a \ - $(MINIX_SOURCE)/stdlib/libppc.a +#STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ +# $(MINIX_SOURCE)/stdlib/libgcc.a \ +# $(MINIX_SOURCE)/stdlib/libppc.a +STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a LIBPCI := $(MINIX_SOURCE)/stdlib/libpci.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel -I../../../../../../yanakernel0prototype/yanakernel0a/sample/$(MINIX_CHIP)/common +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(DRIVER) @@ -51,8 +59,10 @@ $(LIBDRIVER): cd ../../../libdriver && $(MAKE) -$(DRIVER): $(OBJECTS) $(LIBPCI) $(SYSLIBS) $(STDLIBS) $(LIBDRIVER) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(LIBPCI) $(STDLIBS) > misc/$@.last.make +#$(DRIVER): $(OBJECTS) $(LIBPCI) $(SYSLIBS) $(STDLIBS) $(LIBDRIVER) +$(DRIVER): $(OBJECTS) $(LIBDRIVER) $(LIBPCI) $(SYSLIBS) $(STDLIBS) +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(LIBPCI) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 8kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/drivers/arch/ppc/at_wini/at_wini.c minix/src/drivers/arch/ppc/at_wini/at_wini.c --- _/minix/src/drivers/arch/ppc/at_wini/at_wini.c 2006-09-07 23:28:54.000000000 +0900 +++ minix/src/drivers/arch/ppc/at_wini/at_wini.c 2010-11-11 00:00:00.000000000 +0900 @@ -270,12 +270,25 @@ #define ENABLE_WARNINGS #define PRINTER printf #include +#if 0 +#else /* patch */ +#undef TESTMIPS32 +#undef TESTMIPS64 +#include "device.h" +#endif /*===========================================================================* * at_winchester_task * *===========================================================================*/ PUBLIC int main(void) { int rtn; +#if 0 +#else /* patch */ + int index; + vir_bytes off; + u32_t seg; + sys_segctl(&index, &seg, &off, DEVICE_DISK_OFFSET, DEVICE_DISK_BUFFER + DEVICE_DISK_BUFFER_LEN - DEVICE_DISK_OFFSET); +#endif /* Install signal handlers. Ask PM to transform signal into message. */ struct sigaction sigact; @@ -291,10 +304,13 @@ panic("AT_WINI", "sigaction for SIGTERM failed", errno); /* init the ATA layer. */ +#if 0 if( (rtn = Ata.init()) < 0) { warning("Error could not init ATA controller (%d).\n", rtn); return (ERR); } +#else /* patch */ +#endif debug("AT_WINI: %d ATA registers registerd.\n", rtn); @@ -376,6 +392,7 @@ struct driver *dp; message *m_ptr; { +#if 0 /* Device open: Initialize the controller and read the partition table. */ struct wini *wn; int pcount; @@ -458,6 +475,12 @@ wn->open_ct++; debug("done.\n"); return(OK); +#else /* patch */ + if (w_prepare(m_ptr->DEVICE) == NIL_DEV) { + return ENXIO; + } + return OK; +#endif } /*===========================================================================* @@ -465,6 +488,7 @@ *===========================================================================*/ PRIVATE struct device *w_prepare(int device) { +#if 0 /* Prepare for I/O on a device. */ w_device = device; @@ -484,6 +508,15 @@ } return(w_dv); +#else /* patch */ + if (device >= MAX_DRIVES) { + return NIL_DEV; + } + w_drive = device; + w_wn = &wini[w_drive]; + w_dv = &w_wn->part[0]; + return w_dv; +#endif } /*===========================================================================* @@ -604,10 +637,16 @@ *===========================================================================*/ PRIVATE char *w_name() { +#if 0 /* Return a name for the current device. */ static char name[] = "AT-D0"; name[4] = '0' + w_drive; return name; +#else /* patch */ +warning("{w_name}\n"); +while (1) { +} +#endif } /*===========================================================================* @@ -752,6 +791,7 @@ unsigned nr_req; /* length of request vector */ int safe; { +#if 0 struct wini *wn = w_wn; iovec_t *iop, *iov_end = iov + nr_req; int r, s, errors; @@ -890,6 +930,55 @@ w_command = CMD_IDLE; return(OK); +#else /* patch */ + unsigned int i; + unsigned long o; + o = 0; + for (i = 0; i < nr_req; ++i) { + phys_bytes p; + if (iov[i].iov_size % SECTOR_SIZE != 0) { +warning("{w_transfer iov_size(%d)}\n", iov[i].iov_size); +while (1) { +} + } + if (safe) { + if (sys_umap(proc_nr, GRANT_SEG, iov[i].iov_addr, iov[i].iov_size, &p) != OK) { +warning("{w_transfer safe(%d)}\n", safe); +while (1) { +} + } + } else { + if (sys_umap(proc_nr, D, iov[i].iov_addr, iov[i].iov_size, &p) != OK) { +warning("{w_transfer safe(%d)}\n", safe); +while (1) { +} + } + } + while (iov[i].iov_size > 0) { + if (opcode != DEV_GATHER) { + sys_physcopy(NONE, PHYS_SEG, p, NONE, PHYS_SEG, DEVICE_DISK_BUFFER, SECTOR_SIZE); + } + *(volatile unsigned int *)DEVICE_DISK_OFFSET = ex64lo(add64u(position, o)); + *(volatile unsigned int *)DEVICE_DISK_OFFSET_HIGH32 = ex64hi(add64u(position, o)); + *(volatile unsigned int *)DEVICE_DISK_ID = w_drive; + if (opcode == DEV_GATHER) { + *(volatile unsigned int *)DEVICE_DISK_START_OPERATION = DEVICE_DISK_OPERATION_READ; + } else { + *(volatile unsigned int *)DEVICE_DISK_START_OPERATION = DEVICE_DISK_OPERATION_WRITE; + } + if (*(volatile unsigned int *)DEVICE_DISK_STATUS == 0) { + return EIO; + } + if (opcode == DEV_GATHER) { + sys_physcopy(NONE, PHYS_SEG, DEVICE_DISK_BUFFER, NONE, PHYS_SEG, p, SECTOR_SIZE); + } + o += SECTOR_SIZE; + p += SECTOR_SIZE; + iov[i].iov_size -= SECTOR_SIZE; + } + } + return OK; +#endif } /*===========================================================================* @@ -969,11 +1058,18 @@ struct driver *dp; message *m_ptr; { +#if 0 /* Device close: Release a device. */ if (w_prepare(m_ptr->DEVICE) == NIL_DEV) return(ENXIO); w_wn->open_ct--; return(OK); +#else /* patch */ + if (w_prepare(m_ptr->DEVICE) == NIL_DEV) { + return ENXIO; + } + return OK; +#endif } /*===========================================================================* @@ -1168,6 +1264,7 @@ PRIVATE void w_geometry(entry) struct partition *entry; { +#if 0 struct wini *wn = w_wn; if (wn->state & ATAPI) { /* Make up some numbers. */ @@ -1179,6 +1276,11 @@ entry->heads = wn->lheads; entry->sectors = wn->lsectors; } +#else /* patch */ +warning("{w_geometry}\n"); +while (1) { +} +#endif } /*===========================================================================* @@ -1189,6 +1291,7 @@ message *m; int safe; { +#if 0 int r, timeout, prev; if (m->m_type != DEV_IOCTL ) { @@ -1236,6 +1339,11 @@ return OK; } return EINVAL; +#else /* patch */ +warning("{w_other}\n"); +while (1) { +} +#endif } /*===========================================================================* @@ -1245,9 +1353,15 @@ struct driver *dr; message *m; { +#if 0 /* Leftover interrupt(s) received; ack it/them. */ ack_irqs(m->NOTIFY_ARG); return OK; +#else /* patch */ +warning("{w_hw_int}\n"); +while (1) { +} +#endif } diff -ru _/minix/src/drivers/arch/ppc/at_wini/ata.c minix/src/drivers/arch/ppc/at_wini/ata.c --- _/minix/src/drivers/arch/ppc/at_wini/ata.c 2006-09-01 04:08:52.000000000 +0900 +++ minix/src/drivers/arch/ppc/at_wini/ata.c 2010-05-11 00:00:00.000000000 +0900 @@ -169,15 +169,21 @@ #define check_register(r) { if( (r < 0) || (r > (*ctler_io_count)) || ( ctler_selected != 1) ) return ERR; } PRIVATE int writeb(int reg, u8_t data) { +#if 0 check_register(reg); _outb((u8_t*)ctler[reg], data); return OK; +#else /* patch */ +#endif } PRIVATE int readb(int reg, int* dst) { +#if 0 check_register(reg); *dst = _inb((u8_t*)ctler[reg]); return OK; +#else /* patch */ +#endif } PRIVATE int writesw(int reg, int proc_nr, void* buffer, int wcount) { @@ -209,6 +215,7 @@ } PRIVATE int voutb(pvb_pair_t* vout, int count) { +#if 0 int i; /* first check if all port/register numbers are acceptable. */ @@ -221,10 +228,13 @@ _outb((u8_t*)ctler[vout[i].port], vout[i].value); } return OK; +#else /* patch */ +#endif } PRIVATE int vinb(pvb_pair_t* vin, int count) { +#if 0 int i; /* first check if all port/register numbers are acceptable. */ @@ -237,5 +247,7 @@ vin[i].value = _inb((u8_t*)ctler[vin[i].port]); } return OK; +#else /* patch */ +#endif } diff -ru _/minix/src/drivers/arch/ppc/kscreen/Makefile minix/src/drivers/arch/ppc/kscreen/Makefile --- _/minix/src/drivers/arch/ppc/kscreen/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/arch/ppc/kscreen/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -19,11 +19,16 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + LDFLAGS := -m elf32ppc -Bstatic -M diff -ru _/minix/src/drivers/arch/ppc/libpci/Makefile minix/src/drivers/arch/ppc/libpci/Makefile --- _/minix/src/drivers/arch/ppc/libpci/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/arch/ppc/libpci/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -25,11 +25,16 @@ # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel -CFLAGS := -D_EM_WSIZE=4 -mpowerpc -m32 -O3 -Wall \ - -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata \ - -fno-builtin -mno-altivec -static-libgcc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -mpowerpc -m32 -O3 -Wall \ +# -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata \ +# -fno-builtin -mno-altivec -static-libgcc +CFLAGS := -D_EM_WSIZE=4 -Wall \ + -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/drivers/arch/ppc/macio/Makefile minix/src/drivers/arch/ppc/macio/Makefile --- _/minix/src/drivers/arch/ppc/macio/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/arch/ppc/macio/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -21,19 +21,28 @@ $(MINIX_SOURCE)/syslib/libsys.a # $(MINIX_SOURCE)/syslib/libtimers.a +#STDLIBS := \ +#$(MINIX_SOURCE)/stdlib/libc.a \ +#$(MINIX_SOURCE)/stdlib/libppc.a STDLIBS := \ -$(MINIX_SOURCE)/stdlib/libc.a \ -$(MINIX_SOURCE)/stdlib/libppc.a +$(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary @@ -46,7 +55,8 @@ cd ../libdriver && $(MAKE) $(DRIVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) $(LIBDRIVER) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 8kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/drivers/arch/ppc/macio/macio.c minix/src/drivers/arch/ppc/macio/macio.c --- _/minix/src/drivers/arch/ppc/macio/macio.c 2006-09-11 21:50:52.000000000 +0900 +++ minix/src/drivers/arch/ppc/macio/macio.c 2010-06-11 00:00:00.000000000 +0900 @@ -73,7 +73,10 @@ if( sigaction(SIGTERM, &sigact, NULL) < 0 ) warning("MACIO: sigaction for SIGTERM failed %d.\n", errno); +#if 0 macio_init( MACIO_VERBOSE ); /* init devices on the MacIO */ +#else /* patch */ +#endif /* ignore SIGTERM */ /* signal(SIGTERM, SIG_IGN); */ diff -ru _/minix/src/drivers/arch/ppc/macio/via.c minix/src/drivers/arch/ppc/macio/via.c --- _/minix/src/drivers/arch/ppc/macio/via.c 2006-09-11 21:59:18.000000000 +0900 +++ minix/src/drivers/arch/ppc/macio/via.c 2010-05-11 00:00:00.000000000 +0900 @@ -55,13 +55,19 @@ */ static __inline void via_reg_and(int reg, int val) { +#if 0 volatile unsigned char *addr = Via1Base + reg; out8(addr, in8(addr) & val); +#else /* patch */ +#endif } static __inline void via_reg_or(int reg, int val) { +#if 0 volatile unsigned char *addr = Via1Base + reg; out8(addr, in8(addr) | val); +#else /* patch */ +#endif } static __inline void via_reg_xor(int reg, int val) { @@ -70,13 +76,19 @@ } static __inline int read_via_reg(int reg) { +#if 0 volatile unsigned char *addr = Via1Base + reg; return in8(addr); +#else /* patch */ +#endif } static __inline void write_via_reg(int reg, int val) { +#if 0 volatile unsigned char *addr = Via1Base + reg; out8(addr, val); +#else /* patch */ +#endif } @@ -675,6 +687,7 @@ /* Set/get the interrupts the VIA would act on. */ int via_set_interrupt_mask(u32_t interrupts) { +#if 0 /* make sure the interrupt mask only contains valid bits. */ via_data_t via_data; @@ -711,6 +724,8 @@ } return 1; +#else /* patch */ +#endif } u32_t via_get_interrupt_mask(void) { /* to check if a interrupt is set. */ @@ -722,6 +737,7 @@ * config (mainly VIA settings) for the various models od ADB. */ void via_adb_hw_setup(void) { +#if 0 /* * XXX - really PM_VIA_CLR_INTR - should we put it in * pm_direct.h? @@ -730,6 +746,8 @@ udelay(1000); +#else /* patch */ +#endif } @@ -743,6 +761,7 @@ } int via_adb_talk(u8_t* dest, int a, int r) { +#if 0 int i; via_data_t pm_data; u8_t adb_cmd = ADBTALK(a, r); /* create proper command byte */ @@ -830,6 +849,8 @@ udelay(500); return 1; +#else /* patch */ +#endif } @@ -840,6 +861,7 @@ \******************************************************************************/ int via_adb_listen(u8_t* src, int a, int r) { +#if 0 int i; via_data_t pm_data; /* pm data container */ u8_t adb_cmd = (u8_t)ADBLISTEN(a, r); @@ -947,6 +969,8 @@ // splx(s); return 1; +#else /* patch */ +#endif } @@ -956,6 +980,7 @@ \******************************************************************************/ int via_adb_reset(void) { +#if 0 int i; via_data_t pm_data; @@ -1024,6 +1049,8 @@ // splx(s); return 1; +#else /* patch */ +#endif } int via_adb_flush(void) { /* gaan we net zo maken als reset .. */ @@ -1040,6 +1067,7 @@ /* Do a request at the via. */ int via_pmu_request(via_data_t* via_data) { +#if 0 if(!via_initialized) return -1; @@ -1057,6 +1085,8 @@ } return 1; +#else /* patch */ +#endif } diff -ru _/minix/src/drivers/arch/ppc/pcim/Makefile minix/src/drivers/arch/ppc/pcim/Makefile --- _/minix/src/drivers/arch/ppc/pcim/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/arch/ppc/pcim/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -23,22 +23,30 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a -STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ - $(MINIX_SOURCE)/stdlib/libgcc.a \ - $(MINIX_SOURCE)/stdlib/libppc.a +#STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ +# $(MINIX_SOURCE)/stdlib/libgcc.a \ +# $(MINIX_SOURCE)/stdlib/libppc.a +STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a LIBPCI := $(MINIX_SOURCE)/stdlib/libpci.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(DRIVER) @@ -49,8 +57,10 @@ $(LIBDRIVER): $(SYSLIBS) $(STDLIBS) cd ../libdriver && $(MAKE) -$(DRIVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(LIBPCI) $(STDLIBS) > misc/$@.last.make +#$(DRIVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) +$(DRIVER): $(OBJECTS) $(LIBPCI) $(SYSLIBS) $(STDLIBS) +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(LIBPCI) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 4kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/drivers/arch/ppc/pcim/pcim.c minix/src/drivers/arch/ppc/pcim/pcim.c --- _/minix/src/drivers/arch/ppc/pcim/pcim.c 2006-08-25 03:39:32.000000000 +0900 +++ minix/src/drivers/arch/ppc/pcim/pcim.c 2010-06-11 00:00:00.000000000 +0900 @@ -195,9 +195,12 @@ debug("startup.\n"); +#if 0 if( (r = pci_init()) < 0) { warning("error could not init the PCI manager (%d).\n", r); } +#else /* patch */ +#endif printf("PCIM: found %d PCI devices in system.\n", pci_get_device_count()); diff -ru _/minix/src/drivers/arch/ppc/pcim/uni-north.c minix/src/drivers/arch/ppc/pcim/uni-north.c --- _/minix/src/drivers/arch/ppc/pcim/uni-north.c 2006-08-28 01:59:58.000000000 +0900 +++ minix/src/drivers/arch/ppc/pcim/uni-north.c 2010-05-11 00:00:00.000000000 +0900 @@ -70,6 +70,7 @@ /* Hmm */ PRIVATE int badaddr_read(void *addr, size_t size, int *rptr) { +#if 0 // struct faultbuf env; int x = 0; @@ -111,6 +112,8 @@ *rptr = x; return 0; +#else /* patch */ +#endif } /* Hmm 2 */ @@ -124,6 +127,7 @@ #define le_out32(a, v) _le_outw(a, v) PRIVATE pci_reg_t uninorth_read_cfg(/* const pci_device_t* self */ pci_tag_t tag, pci_reg_t reg) { +#if 0 u32_t* daddr = NULL; pci_ctler_t* ctler; /* controller to use */ pci_reg_t data; @@ -173,6 +177,8 @@ // splx(s); return data; +#else /* patch */ +#endif } @@ -181,6 +187,7 @@ * of it to write. */ PRIVATE void uninorth_write_cfg(pci_tag_t tag, pci_reg_t reg, pci_reg_t data) { +#if 0 u32_t* daddr = NULL; pci_ctler_t* ctler; /* controller to use */ int bus, dev, func; @@ -220,6 +227,8 @@ //System.unlock(); +#else /* patch */ +#endif } /* init the uni-north controller(s) diff -ru _/minix/src/drivers/arch/ppc/tty/Makefile minix/src/drivers/arch/ppc/tty/Makefile --- _/minix/src/drivers/arch/ppc/tty/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/arch/ppc/tty/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -23,20 +23,28 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a -STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ - $(MINIX_SOURCE)/stdlib/libppc.a +#STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ +# $(MINIX_SOURCE)/stdlib/libppc.a +STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a # $(MINIX_SOURCE)/stdlib/libd.a \ # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel -I../../../../../../yanakernel0prototype/yanakernel0a/sample/$(MINIX_CHIP)/common +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary @@ -49,7 +57,8 @@ cd ../libdriver && $(MAKE) $(DRIVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) $(LIBDRIVER) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 8kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/drivers/arch/ppc/tty/console.c minix/src/drivers/arch/ppc/tty/console.c --- _/minix/src/drivers/arch/ppc/tty/console.c 2006-08-26 16:04:12.000000000 +0900 +++ minix/src/drivers/arch/ppc/tty/console.c 2010-05-11 00:00:00.000000000 +0900 @@ -19,6 +19,12 @@ #define ENABLE_WARNINGS #define PRINTER con_print #include +#if 0 +#else /* patch */ +#undef TESTMIPS32 +#undef TESTMIPS64 +#include "device.h" +#endif /* Some badly needed prototype(s). @@ -135,7 +141,11 @@ /* The width and height are the resolutions of the screen */ if(phys_fb_base == NULL) +#if 0 return -1; +#else /* patch */ + { sys_segctl(&crsi, &csel, &coff, DEVICE_CONS_PUTGETCHAR, 1); return -1; } +#endif /* Memory size to map, a screen of 48x128 characters would * be (1024 * 768) * (depth in bytes) big. @@ -239,7 +249,11 @@ */ PRIVATE void con_putc(const char c) { if(_fb_base == NULL) +#if 0 return; +#else /* patch */ + { device_cons_putchar(c); return; } +#endif draw_char(c); } @@ -384,7 +398,10 @@ } PRIVATE __inline__ void dcbst(const void* addr) { +#if 0 __asm__ __volatile__ ("dcbst 0,%0" :: "r" (addr)); +#else /* patch */ +#endif } PRIVATE void scroll(void) { diff -ru _/minix/src/drivers/arch/ppc/tty/keyboard.c minix/src/drivers/arch/ppc/tty/keyboard.c --- _/minix/src/drivers/arch/ppc/tty/keyboard.c 2006-09-08 02:34:52.000000000 +0900 +++ minix/src/drivers/arch/ppc/tty/keyboard.c 2010-06-11 00:00:00.000000000 +0900 @@ -306,10 +306,17 @@ sc_count--; /* Function keys are being used for debug dumps. */ +#if 0 if( fkey_key(scode) ) continue; +#else /* patch */ +#endif /* Perform make/break processing. */ +#if 0 ch = make_break(scode); +#else /* patch */ + ch = scode; +#endif if (ch <= 0xFF) { /* A normal character. */ diff -ru _/minix/src/drivers/arch/ppc/tty/tty.c minix/src/drivers/arch/ppc/tty/tty.c --- _/minix/src/drivers/arch/ppc/tty/tty.c 2006-09-09 04:04:48.000000000 +0900 +++ minix/src/drivers/arch/ppc/tty/tty.c 2010-06-11 00:00:00.000000000 +0900 @@ -251,6 +251,13 @@ #define ENABLE_WARNINGS #define PRINTER cprintf /* making sure we can print */ #include +#if 0 +#else /* patch */ +#include "glo.h" +#undef TESTMIPS32 +#undef TESTMIPS64 +#include "device.h" +#endif /*===========================================================================* * tty_task * @@ -263,6 +270,14 @@ int r, s; register tty_t *tp; u32_t width, addr, hight; +#if 0 +#else /* patch */ + int index; + int irq_hook_id; + vir_bytes off; + u32_t seg; + sys_segctl(&index, &seg, &off, DEVICE_CONS_PUTGETCHAR, 1); +#endif /* Get the video details from the boot parameters. */ @@ -288,6 +303,12 @@ /* Initialize the Keyboard driver. */ Keyboard.init(); +#if 0 +#else /* patch */ + irq_hook_id = 0; + sys_irqsetpolicy(KEYBOARD_IRQ, 0, &irq_hook_id); + sys_irqenable(&irq_hook_id); +#endif while (TRUE) { @@ -317,8 +338,16 @@ case DEV_PING: notify(tty_mess.m_source); continue; +#if 0 case DEV_SCANCODE: { /* hardware interrupt notification */ Keyboard.write(tty_mess.SC_BUFFER, tty_mess.SC_COUNT); +#else /* patch */ + case HARD_INT: { + u8_t sc; + sc = device_cons_getchar(); + sys_irqenable(&irq_hook_id); + Keyboard.write(&sc, 1); +#endif #if NR_RS_LINES > 0 /* this is not going to work :) */ if (tty_mess.NOTIFY_ARG & rs_irq_set) rs_interrupt(&tty_mess);/* serial I/O */ diff -ru _/minix/src/drivers/libdriver/Makefile minix/src/drivers/libdriver/Makefile --- _/minix/src/drivers/libdriver/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/libdriver/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -28,11 +28,16 @@ # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel -CFLAGS := -D_EM_WSIZE=4 -mpowerpc -m32 -O3 -Wall \ - -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata \ - -fno-builtin -mno-altivec -static-libgcc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -mpowerpc -m32 -O3 -Wall \ +# -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata \ +# -fno-builtin -mno-altivec -static-libgcc +CFLAGS := -D_EM_WSIZE=4 -Wall \ + -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker script LD_SCRIPT := $(MINIX_SOURCE)/lds/drivers.lds diff -ru _/minix/src/drivers/log/Makefile minix/src/drivers/log/Makefile --- _/minix/src/drivers/log/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/log/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -21,18 +21,26 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a -STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ - $(MINIX_SOURCE)/stdlib/libgcc.a +#STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ +# $(MINIX_SOURCE)/stdlib/libgcc.a +STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary @@ -45,7 +53,8 @@ cd ../libdriver && $(MAKE) $(DRIVER): $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 8kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/drivers/memory/Makefile minix/src/drivers/memory/Makefile --- _/minix/src/drivers/memory/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/drivers/memory/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -17,20 +17,28 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a -STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ - $(MINIX_SOURCE)/stdlib/libgcc.a +#STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ +# $(MINIX_SOURCE)/stdlib/libgcc.a +STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a LIBDRIVER := ../libdriver/driver.o # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(DRIVER) @@ -42,7 +50,8 @@ cd ../libdriver && $(MAKE) $(DRIVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) $(LIBDRIVER) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(LIBDRIVER) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 8kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/image/Makefile minix/src/image/Makefile --- _/minix/src/image/Makefile 2006-09-24 20:52:46.000000000 +0900 +++ minix/src/image/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -62,7 +62,7 @@ .PHONY: minixppc minixppc: $(KERNEL) $(SVR_PM) $(SVR_FS) $(SVR_RS) $(DRV_MEMORY) $(DRV_LOG) $(DRV_TTY) $(DRV_MACIO) $(DRV_PCIM) $(DRV_AT_WINI) $(SVR_DS) $(SVR_DBG) $(SVR_INIT) @mkimage -image $@ $(KERNEL) $(SVR_PM) $(SVR_FS) $(SVR_RS) $(SVR_DS) $(DRV_TTY) $(DRV_MEM) $(DRV_LOG) $(SVR_DBG) $(DRV_PCIM) $(DRV_DRVR) $(DRV_MACIO) $(SVR_INIT) - @cp -v minixppc $(MINIX_FS)/boot/ +# @cp -v minixppc $(MINIX_FS)/boot/ @cp -v minixppc minixppc_$(EXEC) .PHONY: clean Files _/minix/src/image/minixppc and minix/src/image/minixppc differ Files _/minix/src/image/minixppc_aout and minix/src/image/minixppc_aout differ diff -ru _/minix/src/include/minix/ipc.h minix/src/include/minix/ipc.h --- _/minix/src/include/minix/ipc.h 2006-09-19 01:04:48.000000000 +0900 +++ minix/src/include/minix/ipc.h 2010-09-11 00:00:00.000000000 +0900 @@ -102,11 +102,177 @@ #define receive _receive #define send _send +#if 0 _PROTOTYPE( int echo, (message *m_ptr) ); _PROTOTYPE( int notify, (endpoint_t dest) ); _PROTOTYPE( int sendrec, (endpoint_t src_dest, message *m_ptr) ); _PROTOTYPE( int receive, (endpoint_t src, message *m_ptr) ); _PROTOTYPE( int send, (endpoint_t dest, message *m_ptr) ); +#else /* patch */ +#if defined(__arm__) +#if defined(MINIX_ENABLE_YK0A) +__inline__ static int echo(message *m_ptr) { + register int r0 __asm__("r0") = 2; /* YK0A_PROCEDURE_CALL */ + register int r1 __asm__("r1") = 1; + register int r2 __asm__("r2") = 8; /* ECHO */ + register int r4 __asm__("r4") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2), "r"(r4) : "memory"); + return r0; +} +__inline__ static int notify(endpoint_t dest) { + register int r0 __asm__("r0") = 2; /* YK0A_PROCEDURE_CALL */ + register int r1 __asm__("r1") = 1; + register int r2 __asm__("r2") = 4; /* NOTIFY */ + register int r3 __asm__("r3") = dest; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2), "r"(r3) : "memory"); + return r0; +} +__inline__ static int sendrec(endpoint_t src_dest, message *m_ptr) { + register int r0 __asm__("r0") = 2; /* YK0A_PROCEDURE_CALL */ + register int r1 __asm__("r1") = 1; + register int r2 __asm__("r2") = 3; /* SENDREC */ + register int r3 __asm__("r3") = src_dest; + register int r4 __asm__("r4") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4) : "memory"); + return r0; +} +__inline__ static int receive(endpoint_t src, message *m_ptr) { + register int r0 __asm__("r0") = 2; /* YK0A_PROCEDURE_CALL */ + register int r1 __asm__("r1") = 1; + register int r2 __asm__("r2") = 2; /* RECEIVE */ + register int r3 __asm__("r3") = src; + register int r4 __asm__("r4") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4) : "memory"); + return r0; +} +__inline__ static int send(endpoint_t dest, message *m_ptr) { + register int r0 __asm__("r0") = 2; /* YK0A_PROCEDURE_CALL */ + register int r1 __asm__("r1") = 1; + register int r2 __asm__("r2") = 1; /* SEND */ + register int r3 __asm__("r3") = dest; + register int r4 __asm__("r4") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4) : "memory"); + return r0; +} +#else +__inline__ static int echo(message *m_ptr) { + register int r0 __asm__("r0") = 8; /* ECHO */ + register int r2 __asm__("r2") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r2) : "memory"); + return r0; +} +__inline__ static int notify(endpoint_t dest) { + register int r0 __asm__("r0") = 4; /* NOTIFY */ + register int r1 __asm__("r1") = dest; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1) : "memory"); + return r0; +} +__inline__ static int sendrec(endpoint_t src_dest, message *m_ptr) { + register int r0 __asm__("r0") = 3; /* SENDREC */ + register int r1 __asm__("r1") = src_dest; + register int r2 __asm__("r2") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2) : "memory"); + return r0; +} +__inline__ static int receive(endpoint_t src, message *m_ptr) { + register int r0 __asm__("r0") = 2; /* RECEIVE */ + register int r1 __asm__("r1") = src; + register int r2 __asm__("r2") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2) : "memory"); + return r0; +} +__inline__ static int send(endpoint_t dest, message *m_ptr) { + register int r0 __asm__("r0") = 1; /* SEND */ + register int r1 __asm__("r1") = dest; + register int r2 __asm__("r2") = (int)m_ptr; + __asm__ __volatile__("swi 0" : "=r"(r0) : "0"(r0), "r"(r1), "r"(r2) : "memory"); + return r0; +} +#endif +#elif defined(__mips__) +#if defined(MINIX_ENABLE_YK0A) +__inline__ static int echo(message *m_ptr) { + register int gpr2 __asm__("$2") = 2; /* YK0A_PROCEDURE_CALL */ + register int gpr3 __asm__("$3") = 1; + register int gpr4 __asm__("$4") = 8; /* ECHO */ + register int gpr6 __asm__("$6") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4), "r"(gpr6) : "memory"); + return gpr2; +} +__inline__ static int notify(endpoint_t dest) { + register int gpr2 __asm__("$2") = 2; /* YK0A_PROCEDURE_CALL */ + register int gpr3 __asm__("$3") = 1; + register int gpr4 __asm__("$4") = 4; /* NOTIFY */ + register int gpr5 __asm__("$5") = dest; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4), "r"(gpr5) : "memory"); + return gpr2; +} +__inline__ static int sendrec(endpoint_t src_dest, message *m_ptr) { + register int gpr2 __asm__("$2") = 2; /* YK0A_PROCEDURE_CALL */ + register int gpr3 __asm__("$3") = 1; + register int gpr4 __asm__("$4") = 3; /* SENDREC */ + register int gpr5 __asm__("$5") = src_dest; + register int gpr6 __asm__("$6") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4), "r"(gpr5), "r"(gpr6) : "memory"); + return gpr2; +} +__inline__ static int receive(endpoint_t src, message *m_ptr) { + register int gpr2 __asm__("$2") = 2; /* YK0A_PROCEDURE_CALL */ + register int gpr3 __asm__("$3") = 1; + register int gpr4 __asm__("$4") = 2; /* RECEIVE */ + register int gpr5 __asm__("$5") = src; + register int gpr6 __asm__("$6") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4), "r"(gpr5), "r"(gpr6) : "memory"); + return gpr2; +} +__inline__ static int send(endpoint_t dest, message *m_ptr) { + register int gpr2 __asm__("$2") = 2; /* YK0A_PROCEDURE_CALL */ + register int gpr3 __asm__("$3") = 1; + register int gpr4 __asm__("$4") = 1; /* SEND */ + register int gpr5 __asm__("$5") = dest; + register int gpr6 __asm__("$6") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4), "r"(gpr5), "r"(gpr6) : "memory"); + return gpr2; +} +#else +__inline__ static int echo(message *m_ptr) { + register int gpr2 __asm__("$2") = 8; /* ECHO */ + register int gpr4 __asm__("$4") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr4) : "memory"); + return gpr2; +} +__inline__ static int notify(endpoint_t dest) { + register int gpr2 __asm__("$2") = 4; /* NOTIFY */ + register int gpr3 __asm__("$3") = dest; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3) : "memory"); + return gpr2; +} +__inline__ static int sendrec(endpoint_t src_dest, message *m_ptr) { + register int gpr2 __asm__("$2") = 3; /* SENDREC */ + register int gpr3 __asm__("$3") = src_dest; + register int gpr4 __asm__("$4") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4) : "memory"); + return gpr2; +} +__inline__ static int receive(endpoint_t src, message *m_ptr) { + register int gpr2 __asm__("$2") = 2; /* RECEIVE */ + register int gpr3 __asm__("$3") = src; + register int gpr4 __asm__("$4") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4) : "memory"); + return gpr2; +} +__inline__ static int send(endpoint_t dest, message *m_ptr) { + register int gpr2 __asm__("$2") = 1; /* SEND */ + register int gpr3 __asm__("$3") = dest; + register int gpr4 __asm__("$4") = (int)m_ptr; + __asm__ __volatile__("syscall" : "=r"(gpr2) : "0"(gpr2), "r"(gpr3), "r"(gpr4) : "memory"); + return gpr2; +} +#endif +#else +#error echo notify sendrec receive send +#endif +#endif #define ipc_request _ipc_request #define ipc_reply _ipc_reply diff -ru _/minix/src/include/setjmp.h minix/src/include/setjmp.h --- _/minix/src/include/setjmp.h 2006-09-07 07:45:12.000000000 +0900 +++ minix/src/include/setjmp.h 2010-09-11 00:00:00.000000000 +0900 @@ -111,6 +111,7 @@ long __mask; /* must have size >= sizeof(sigset_t) */ /* second part, powerpc only. */ +#if 0 void* __sp; /* stack pointer */ void* __lr; /* link register, this is also the return address for longjmp ! */ void* __cr; /* (general) condition register */ @@ -118,6 +119,34 @@ void* __gpr[18]; /* gprs 14 t/m 31 */ /* void* __fcr; float condition register */ void* __fpr[18 * 2]; /* fprs 14 t/m 31 */ +#else /* patch */ +#if defined(__arm__) + unsigned int r4; + unsigned int r5; + unsigned int r6; + unsigned int r7; + unsigned int r8; + unsigned int r9; + unsigned int r10; + unsigned int fp; + unsigned int sp; + unsigned int lr; +#elif defined(__mips__) + unsigned int gpr16; + unsigned int gpr17; + unsigned int gpr18; + unsigned int gpr19; + unsigned int gpr20; + unsigned int gpr21; + unsigned int gpr22; + unsigned int gpr23; + unsigned int sp; + unsigned int fp; + unsigned int lr; +#else +#error jmp_buf +#endif +#endif } jmp_buf[1]; diff -ru _/minix/src/kernel/Makefile minix/src/kernel/Makefile --- _/minix/src/kernel/Makefile 2006-09-24 21:01:02.000000000 +0900 +++ minix/src/kernel/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -18,7 +18,8 @@ system.o \ table.o \ kprintf.o \ -kdebug.o +kdebug.o \ +../$(MINIX_CHIP)/glue.o # programs used for compiling and linking. CC := $(MINIX_GCC) @@ -32,23 +33,32 @@ CFLAGS_ASSM := -D__ASSEMBLY__ -D_KERNEL # ../include is the minix /usr/ include. -INCLUDE := -nostdinc -I./ -I../include -I../arch/ppc +#INCLUDE := -nostdinc -I./ -I../include -I../arch/ppc +INCLUDE := -I./ -I../include -I../arch/ppc -I../../../yanakernel0prototype/yanakernel0a/sample/$(MINIX_CHIP)/common -I../../../yanakernel0prototype/yanakernel0a/kernel/$(MINIX_CHIP) +#CFLAGS := -D_KERNEL -D_SYSTEM -D_MINIX -D_EM_WSIZE=4 -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_KERNEL -D_SYSTEM -D_MINIX -D_EM_WSIZE=4 -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + \ + -DMINIX_PROCESS=$(MINIX_PROCESS) # Linker options -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,MINIX -Wl,-Ttext,$(MINIX_KERNEL) -Wl,--defsym=__text_start=$(MINIX_KERNEL) +LDLIBS = -nostdlib -lgcc # Some symbols not made by the compiler (maybe i need a flag "ofzo") # these are needed for the Minix headers and kernel # SYMBOLS := -D_MINIX -D_KERNEL -D_SYSTEM -D__minix -D_EM_WSIZE=4 # Libraries we need. -STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ - $(MINIX_SOURCE)/stdlib/libppc.a \ - $(MINIX_SOURCE)/stdlib/libgcc.a +#STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ +# $(MINIX_SOURCE)/stdlib/libppc.a \ +# $(MINIX_SOURCE)/stdlib/libgcc.a +STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a SYSLIBS := $(MINIX_SOURCE)/syslib/libtimers.a \ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libsysutil.a @@ -67,7 +77,8 @@ # monitor a lot easyer. # # I will change this eventualy -FIRST_OBJECT := ./arch/$(ARCH)/minix.o +#FIRST_OBJECT := ./arch/$(ARCH)/minix.o +FIRST_OBJECT := ../$(MINIX_CHIP)/minix.o all: kernel @@ -95,8 +106,10 @@ cd ./arch/$(ARCH) && $(MAKE) # Build rule for the machine independent kernel part. -kernel: $(OBJECTS) $(KSYSLIB) $(KLIBARCH) $(FIRST_OBJECT) $(LD_SCRIPT) $(KSCREEN) - $(LD) $(LDFLAGS) -o elf32/$@ $(FIRST_OBJECT) --start-group $(OBJECTS) $(KSYSLIB) $(KLIBARCH) $(KSCREEN) $(SYSLIBS) $(STDLIBS) --end-group > misc/$@.last.make +#kernel: $(OBJECTS) $(KSYSLIB) $(KLIBARCH) $(FIRST_OBJECT) $(LD_SCRIPT) $(KSCREEN) +kernel: $(FIRST_OBJECT) $(OBJECTS) $(KSYSLIB) $(KLIBARCH) $(KSCREEN) $(SYSLIBS) $(STDLIBS) +# $(LD) $(LDFLAGS) -o elf32/$@ $(FIRST_OBJECT) --start-group $(OBJECTS) $(KSYSLIB) $(KLIBARCH) $(KSCREEN) $(SYSLIBS) $(STDLIBS) --end-group > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make # NOTE a ZerO stack for the kernel. @elf2aout -v -S 0 elf32/$@ aout/$@ diff -ru _/minix/src/kernel/arch/ppc/Makefile minix/src/kernel/arch/ppc/Makefile --- _/minix/src/kernel/arch/ppc/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/kernel/arch/ppc/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -4,17 +4,24 @@ LIBRARYDIR := . LIBRARY := arch.a +#OBJECTS := debug/debug_msg.o \ +# debug/debug_info.o \ +# debug/debug_mem.o \ +# debug/debug_proc.o \ +# debug/debug_stack.o \ +# debug/debug_trace.o \ +# exception.o \ +# clock.o \ +# memory.o \ +# interrupt.o \ +# system.o \ +# image.o OBJECTS := debug/debug_msg.o \ debug/debug_info.o \ debug/debug_mem.o \ debug/debug_proc.o \ debug/debug_stack.o \ debug/debug_trace.o \ - exception.o \ - clock.o \ - memory.o \ - interrupt.o \ - system.o \ image.o # klibppc.o @@ -32,11 +39,16 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/kernel -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/kernel -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/kernel -I$(MINIX_SOURCE)/arch/ppc +#CFLAGS := -D_KERNEL -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -static-libgcc CFLAGS := -D_KERNEL -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -static-libgcc + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + LDFLAGS := -m elf32ppc -Bstatic -M diff -ru _/minix/src/kernel/arch/ppc/debug/debug_mem.c minix/src/kernel/arch/ppc/debug/debug_mem.c --- _/minix/src/kernel/arch/ppc/debug/debug_mem.c 2006-09-09 18:52:52.000000000 +0900 +++ minix/src/kernel/arch/ppc/debug/debug_mem.c 2010-05-11 00:00:00.000000000 +0900 @@ -18,6 +18,7 @@ void debug_pat_print_segment_registers(void) { +#if 0 int i, j; printer("Current (on CHIP) segment registers,\n"); @@ -29,6 +30,8 @@ j + 2, mfsr(j + 2), j + 3, mfsr(j + 3)); } +#else /* patch */ +#endif } /* @@ -52,6 +55,7 @@ * count - number of pteg to print. */ void debug_pat_print_pt(pte_t* first_pteg, size_t count) { +#if 0 int i, j; pte_t pteg[8]; /* <- 16 words */ @@ -79,12 +83,15 @@ printer("\n"); first_pteg += 8; } +#else /* patch */ +#endif } /* pteg - address to first pteg to print. * count - number of pteg to print. */ void debug_pat_print_pt_small(pte_t* first_pteg, size_t count) { +#if 0 int i, j; pte_t pteg[8]; /* <- 16 words */ @@ -108,11 +115,14 @@ printer("\n"); first_pteg += 8; } +#else /* patch */ +#endif } /* Printing stuff about the memory setup. */ void debug_pat(void) { +#if 0 pte_t* appteg; /* address to variables to use in calculations and */ pte_t* aspteg; /* extra return, for the user of the function.*/ int i; @@ -130,9 +140,12 @@ mmu_pat_seg_ea2pteg(&appteg, &aspteg, segdesc, 0); debug_pat_print_pt_small(appteg, 1); /* print ppte group */ } +#else /* patch */ +#endif } void debug_pat_seg_address(segdesc_t segdesc, u32_t ea) { +#if 0 pte_t* appteg; pte_t* aspteg; @@ -142,11 +155,16 @@ printer("Content primary page table entry group,\n"); debug_pat_print_pt(appteg, 1); /* print ppte group */ printer("Using segment descriptor %08x, effective address %08x maps to physical address %08x\n", segdesc, ea, mmu_pat_seg_ea2pa(segdesc, ea)); +#else /* patch */ +#endif } void debug_pat_address(u32_t ea) { +#if 0 segdesc_t segdesc = mfsr(ea2sr(ea)); debug_pat_seg_address(segdesc, ea); +#else /* patch */ +#endif } void debug_pat_print_pte_info(pte_t* pte) { diff -ru _/minix/src/kernel/arch/ppc/debug/debug_stack.c minix/src/kernel/arch/ppc/debug/debug_stack.c --- _/minix/src/kernel/arch/ppc/debug/debug_stack.c 2006-09-09 18:57:20.000000000 +0900 +++ minix/src/kernel/arch/ppc/debug/debug_stack.c 2010-05-11 00:00:00.000000000 +0900 @@ -11,6 +11,7 @@ #include "printer.h" void debug_stackframe(const stackframe_t* sframe) { +#if 0 int i = 0; printer("Printing stackframe at: %08x\n" @@ -46,6 +47,8 @@ sframe->cr, sframe->xer, sframe->lr, sframe->ctr, sframe->pc, sframe->psw); +#else /* patch */ +#endif } /* @@ -73,6 +76,7 @@ } void debug_signal_context(const struct sigcontext* sc) { +#if 0 int i = 0; printer("Printing signal context at: %08x\n" @@ -112,5 +116,7 @@ sc->sc_regs.cr, sc->sc_regs.xer, sc->sc_regs.lr, sc->sc_regs.ctr, sc->sc_regs.pc, sc->sc_regs.psw); +#else /* patch */ +#endif } diff -ru _/minix/src/kernel/glo.h minix/src/kernel/glo.h --- _/minix/src/kernel/glo.h 2006-08-17 22:24:44.000000000 +0900 +++ minix/src/kernel/glo.h 2010-05-11 00:00:00.000000000 +0900 @@ -82,7 +82,10 @@ /* Variables that are initialized elsewhere are just extern here. */ extern struct boot_image image[]; /* system image processes */ extern char *t_stack[]; /* task stack space */ +#if 0 extern struct segdesc_s gdt[]; /* global descriptor table */ +#else /* patch */ +#endif EXTERN _PROTOTYPE( void (*level0_func), (void) ); diff -ru _/minix/src/kernel/main.c minix/src/kernel/main.c --- _/minix/src/kernel/main.c 2006-09-15 21:28:00.000000000 +0900 +++ minix/src/kernel/main.c 2010-06-11 00:00:00.000000000 +0900 @@ -159,7 +159,11 @@ /* Convert addresses to clicks and build process memory map. * Note, a_syms is misused as text base address. */ +#if 0 text_base = e_hdr.a_syms >> CLICK_SHIFT; +#else /* patch */ + text_base = (unsigned long)e_hdr.a_syms >> CLICK_SHIFT; +#endif text_clicks = (e_hdr.a_text + CLICK_SIZE-1) >> CLICK_SHIFT; // data_clicks = (e_hdr.a_data+e_hdr.a_bss + CLICK_SIZE-1) >> CLICK_SHIFT; data_clicks = (e_hdr.a_total + CLICK_SIZE-1) >> CLICK_SHIFT; /* MinixPPC 311 */ @@ -227,12 +231,15 @@ //while(1); kdebug("System.restart()\n"); +#if 0 System.restart(); /* no return */ /* XXX */ debug("BFE, RESTART returned?\n"); while(1) ; +#else /* patch */ +#endif } /*===========================================================================* diff -ru _/minix/src/kernel/start.c minix/src/kernel/start.c --- _/minix/src/kernel/start.c 2006-09-09 02:06:04.000000000 +0900 +++ minix/src/kernel/start.c 2010-05-11 00:00:00.000000000 +0900 @@ -39,10 +39,18 @@ #endif /* Prepare system info. (this is the best way) */ +#if 0 kinfo.code_base = Memory.seg2phys(cs); +#else /* patch */ + kinfo.code_base = stext; +#endif kinfo.code_size = etext - stext; kinfo.kmem_base = +#if 0 kinfo.data_base = Memory.seg2phys(ds); +#else /* patch */ + kinfo.data_base = sdata; +#endif kinfo.data_size = edata - sdata; kinfo.kmem_size = end - sdata; @@ -69,10 +77,13 @@ * the powerpc G4 is number 740, * Decide if mode is protected for older machines. */ +#if 0 machine.processor=atoi(get_value(params, "processor")); #if _WORD_SIZE == 2 machine.prot = machine.processor >= 286; #endif +#else /* patch */ +#endif /* disable monitor return at all times. */ /* if (! machine.prot) */ mon_return = 0; @@ -86,9 +97,12 @@ } /* Type of VDU: */ +#if 0 value = get_value(params, "video"); /* EGA or VGA video unit */ if (strcmp(value, "ega") == 0) machine.vdu_ega = TRUE; if (strcmp(value, "vga") == 0) machine.vdu_vga = machine.vdu_ega = TRUE; +#else /* patch */ +#endif /* At the moment return errors of the system initialization * aren't checked. diff -ru _/minix/src/kernel/system/Makefile minix/src/kernel/system/Makefile --- _/minix/src/kernel/system/Makefile 2006-09-24 19:27:04.000000000 +0900 +++ minix/src/kernel/system/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -53,11 +53,16 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/kernel -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/kernel -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/kernel -I$(MINIX_SOURCE)/arch/ppc +#CFLAGS := -D_KERNEL -D_SYSTEM -D_MINIX -D_EM_WSIZE=4 -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_KERNEL -D_SYSTEM -D_MINIX -D_EM_WSIZE=4 -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + LDFLAGS := -m elf32ppc -Bstatic -M diff -ru _/minix/src/kernel/system/do_debug.c minix/src/kernel/system/do_debug.c --- _/minix/src/kernel/system/do_debug.c 2006-09-12 02:45:12.000000000 +0900 +++ minix/src/kernel/system/do_debug.c 2010-05-11 00:00:00.000000000 +0900 @@ -574,6 +574,7 @@ } void do_debug_kernel_info(void) { +#if 0 extern char kstk_top, kstk_bottom; char *k_stack_top = &kstk_top, *k_stack_bottom = &kstk_bottom; @@ -612,9 +613,12 @@ if(bill_ptr != NULL) printer("(%08x) p_name %s, p_nr %d\n", vir2phys(bill_ptr), bill_ptr->p_name, bill_ptr->p_nr); else printer("(NULL)\n"); +#else /* patch */ +#endif } void do_debug_current_process_cpu(void) { +#if 0 /* int i, j; */ struct proc* rp = (struct proc*)mfspr(SPRG3); /* for current process */ do_debug_print_process_info(rp); @@ -632,6 +636,8 @@ j + 3, rp->p_seg.sr[j + 3]); } */ +#else /* patch */ +#endif } void do_debug_view_mem(message* m_ptr) { @@ -666,6 +672,7 @@ void do_debug_pt_debug(message* m_ptr) { +#if 0 pte_t* appteg; /* first pte of a group */ pte_t* aspteg; u32_t ea = m_ptr->m5_l1; @@ -683,10 +690,13 @@ printer("SPTEG ----------------------------------------------------------------\n"); debug_pat_print_pt_small(aspteg, count); +#else /* patch */ +#endif } void do_debug_pt_print_pte_info(message* m_ptr) { +#if 0 pte_t* appteg; /* first pte of a group */ pte_t* aspteg; u32_t ea = m_ptr->m5_l1, found = 0; @@ -726,10 +736,13 @@ } } /* for */ } +#else /* patch */ +#endif } void do_debug_cpu_msr(void) { +#if 0 // static char* msrflags[] = {"POW","ILE","EI","PR","FP","MC","FE0", // "SE","BE","FE1","IP","IR","DR","RI","LE"}; u32_t msr = mfmsr(); @@ -751,13 +764,18 @@ if(msr & MSR_RI) printer(" RI"); /* Recoverable exception */ if(msr & MSR_LE) printer(" LE"); /* Little-endian mode */ printer(" ] (0x%08x)\n", msr); +#else /* patch */ +#endif } void do_debug_cpu(void) { +#if 0 printer("Debug CPU.\n"); debug_pat_print_segment_registers(); printer("SPRG0: %08x SPRG1 %08x, SPRG2 %08x, SPRG3 %08x\n", mfspr(SPRG0), mfspr(SPRG1), mfspr(SPRG2), mfspr(SPRG3)); do_debug_cpu_msr(); +#else /* patch */ +#endif } /* print the remote segments for a process. diff -ru _/minix/src/kernel/system/do_nice.c minix/src/kernel/system/do_nice.c --- _/minix/src/kernel/system/do_nice.c 2006-08-12 23:40:52.000000000 +0900 +++ minix/src/kernel/system/do_nice.c 2010-11-11 00:00:00.000000000 +0900 @@ -30,7 +30,13 @@ if (pri == PRIO_STOP) { /* Take process off the scheduling queues. */ +#if 0 lock_dequeue(rp); +#else /* patch */ + if (!rp->p_rts_flags) { + lock_dequeue(rp); + } +#endif rp->p_rts_flags |= NO_PRIORITY; return(OK); } diff -ru _/minix/src/kernel/system/do_sigsend.c minix/src/kernel/system/do_sigsend.c --- _/minix/src/kernel/system/do_sigsend.c 2006-09-05 23:09:20.000000000 +0900 +++ minix/src/kernel/system/do_sigsend.c 2010-07-11 00:00:00.000000000 +0900 @@ -84,11 +84,25 @@ rp->p_reg.lr = smsg.sm_sigreturn; /* The first (and only) parameter for the user signal handler function. */ +#if 0 rp->p_reg.retreg = smsg.sm_signo; /* note the retreg == first argument */ +#else /* patch */ +#if defined(__arm__) + rp->p_reg.retreg = smsg.sm_signo; /* note the retreg == first argument */ +#elif defined(__mips__) + rp->p_reg.gpr4 = smsg.sm_signo; /* note the gpr4 == first argument */ +#else +#error do_sigsend +#endif +#endif #endif /* Reset user registers to execute the signal handler. */ +#if 0 rp->p_reg.sp = (reg_t) frp; +#else /* patch */ + rp->p_reg.sp = (reg_t) frp - MINIX_ARGUMENT; /* ToDo: stack alignment */ +#endif rp->p_reg.pc = (reg_t) smsg.sm_sighandler; return(OK); diff -ru _/minix/src/lib/Makefile minix/src/lib/Makefile --- _/minix/src/lib/Makefile 2006-09-24 18:43:30.000000000 +0900 +++ minix/src/lib/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -22,7 +22,7 @@ .PHONY: arch arch: - cd ./$(ARCH) && $(MAKE) +# cd ./$(ARCH) && $(MAKE) .PHONY: ansi ansi: @@ -66,7 +66,7 @@ .PHONY: string string: - cd ./$(ARCH)/$@ && $(MAKE) +# cd ./$(ARCH)/$@ && $(MAKE) .PHONY: rts rts: diff -ru _/minix/src/lib/ansi/Makefile minix/src/lib/ansi/Makefile --- _/minix/src/lib/ansi/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/ansi/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -41,13 +41,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) @@ -115,7 +120,9 @@ toupper.o \ tzset.o \ wcstombs.o \ -wctomb.o +wctomb.o \ +memchr.o memcmp.o memcpy.o memmove.o memset.o \ +strcat.o strchr.o strcmp.o strcpy.o strlen.o strncat.o strncmp.o strncpy.o strrchr.o all: lib diff -ru _/minix/src/lib/editline/Makefile minix/src/lib/editline/Makefile --- _/minix/src/lib/editline/Makefile 2006-09-24 18:49:44.000000000 +0900 +++ minix/src/lib/editline/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -4,7 +4,8 @@ LIBRARY := libedit.a # Programs -CC := gcc-3.4.6 +#CC := gcc-3.4.6 +CC := $(MINIX_GCC) LD := ld AS := as AR := ar @@ -12,14 +13,20 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -DANSI_ARROWS -DHAVE_STDLIB -DHAVE_TCGETATTR \ +# -DHIDE -DUSE_DIRENT -DHIST_SIZE=100 -DUSE_TERMCAP -DSYS_UNIX \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -DANSI_ARROWS -DHAVE_STDLIB -DHAVE_TCGETATTR \ -DHIDE -DUSE_DIRENT -DHIST_SIZE=100 -DUSE_TERMCAP -DSYS_UNIX \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/gnu/ieee_float/Makefile minix/src/lib/gnu/ieee_float/Makefile --- _/minix/src/lib/gnu/ieee_float/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/gnu/ieee_float/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -20,13 +20,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/math/Makefile minix/src/lib/math/Makefile --- _/minix/src/lib/math/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/math/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -21,13 +21,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/other/Makefile minix/src/lib/other/Makefile --- _/minix/src/lib/other/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/other/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -21,13 +21,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/servers +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/servers +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/servers # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/posix/Makefile minix/src/lib/posix/Makefile --- _/minix/src/lib/posix/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/posix/Makefile 2010-07-11 00:00:00.000000000 +0900 @@ -21,13 +21,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) @@ -129,7 +134,8 @@ getopt.o \ gettimeofday.o \ priority.o \ - usleep.o + usleep.o \ + _sigreturn.x86.o all: lib diff -ru _/minix/src/lib/posix/_sigreturn.ppc.S minix/src/lib/posix/_sigreturn.ppc.S --- _/minix/src/lib/posix/_sigreturn.ppc.S 2006-08-22 05:09:22.000000000 +0900 +++ minix/src/lib/posix/_sigreturn.ppc.S 2010-07-11 00:00:00.000000000 +0900 @@ -78,7 +78,10 @@ * info about the mask and flags and position of the signal context * to the PM. */ +#if 0 _STATIC_ARRAY(message, MESSAGE_SIZE, 4) +#else /* patch */ +#endif /* Offsets into message object, the way everything works. */ @@ -97,6 +100,7 @@ # typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;} mess_2; _GLOBAL_F(sigreturn) +#if 0 # Protect against race conditions by blocking all interrupts. stwu SP, -16(SP) # make some space for a local var. mflr R0 @@ -137,6 +141,22 @@ addi SP, SP, 16 mtlr R0 blr +#else /* patch */ +#if defined(__arm__) +#define SIGFRAME_SIZE 28 /* sizeof(struct sigframe) */ + add r0, sp, #(MINIX_ARGUMENT + SIGFRAME_SIZE) + b _sigreturn +#elif defined(__mips__) +#define SIGFRAME_SIZE 28 /* sizeof(struct sigframe) */ + .set at + .set reorder + addiu $4, $sp, (MINIX_ARGUMENT + SIGFRAME_SIZE) + la $2, _sigreturn + jr $2 +#else +#error sigreturn +#endif +#endif #.section .bss diff -ru _/minix/src/lib/ppc/int64/Makefile minix/src/lib/ppc/int64/Makefile --- _/minix/src/lib/ppc/int64/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/ppc/int64/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -14,12 +14,17 @@ RANLIB := ranlib # compiler flags for a library source file (.c or .S) -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/ppc/rts/Makefile minix/src/lib/ppc/rts/Makefile --- _/minix/src/lib/ppc/rts/Makefile 2006-09-24 20:10:44.000000000 +0900 +++ minix/src/lib/ppc/rts/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -15,12 +15,17 @@ RANLIB := ranlib # compiler flags for a library source file (.c or .S) -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) @@ -30,7 +35,8 @@ crtso.o \ _setjmp.o \ _longjmp.o \ - _loadsize.o + _loadsize.o \ + ../../../$(MINIX_CHIP)/crtso_core.o # sigreturn.o \ diff -ru _/minix/src/lib/ppc/rts/_loadsize.S minix/src/lib/ppc/rts/_loadsize.S --- _/minix/src/lib/ppc/rts/_loadsize.S 2006-09-07 00:31:02.000000000 +0900 +++ minix/src/lib/ppc/rts/_loadsize.S 2010-07-11 00:00:00.000000000 +0900 @@ -6,6 +6,7 @@ /* Here we also initialize the other section link objects. */ .section .data +#if 0 _GLOBAL_O(stext) .long (__text_start) _GLOBAL_O(etext) .long (__text_end) _GLOBAL_O(sdata) .long (__data_start) @@ -13,6 +14,27 @@ _GLOBAL_O(sbss) .long (__bss_start) _GLOBAL_O(ebss) .long (__bss_end) _GLOBAL_O(end) .long (__bss_end) +#else /* patch */ +#if defined(__arm__) +_GLOBAL_O(stext) .long (__text_start) /* ToDo: linker script */ +_GLOBAL_O(etext) .long (_etext) +_GLOBAL_O(sdata) .long (__data_start) +_GLOBAL_O(edata) .long (_edata) +_GLOBAL_O(sbss) .long (__bss_start) +_GLOBAL_O(ebss) .long (_end) +_GLOBAL_O(end) .long (_end) +#elif defined(__mips__) +_GLOBAL_O(stext) .long (_ftext) +_GLOBAL_O(etext) .long (_etext) +_GLOBAL_O(sdata) .long (_fdata) +_GLOBAL_O(edata) .long (_edata) +_GLOBAL_O(sbss) .long (_fbss) +_GLOBAL_O(ebss) .long (_end) +_GLOBAL_O(end) .long (_end) +#else +#error stext etext sdata edata sbss ebss end +#endif +#endif /* To use these values diff -ru _/minix/src/lib/ppc/rts/_longjmp.S minix/src/lib/ppc/rts/_longjmp.S --- _/minix/src/lib/ppc/rts/_longjmp.S 2006-09-05 18:01:52.000000000 +0900 +++ minix/src/lib/ppc/rts/_longjmp.S 2010-09-11 00:00:00.000000000 +0900 @@ -22,6 +22,7 @@ #define JMP_BUF_SIZE 240 /* in bytes */ _GLOBAL_F(_longjmp) +#if 0 addi R3, R3, JMP_BUF_SIZE # The lfdu instruction first decrement the address @@ -53,6 +54,41 @@ # The context is now return to that of the setjmp call, with # the only difference in the return value, thats not zero but _val (R4). blr +#else /* patch */ +#if defined(__arm__) +#define OFFSET(a) ((a) * 4 + 8) + add r0, r0, #OFFSET(10) + ldmdb r0!, {r4-r11, sp, lr} + cmp r1, #0 + bne 0f + mov r1, #1 +0: + mov r0, r1 + mov pc, lr +#elif defined(__mips__) +#define OFFSET(a) ((a) * 4 + 8) + .set at + .set reorder + lw $16, OFFSET(0)($4) + lw $17, OFFSET(1)($4) + lw $18, OFFSET(2)($4) + lw $19, OFFSET(3)($4) + lw $20, OFFSET(4)($4) + lw $21, OFFSET(5)($4) + lw $22, OFFSET(6)($4) + lw $23, OFFSET(7)($4) + lw $sp, OFFSET(8)($4) + lw $fp, OFFSET(9)($4) + lw $ra, OFFSET(10)($4) + bne $5, $0, 0f + li $5, 1 +0: + move $2, $5 + jr $ra +#else +#error _longjmp +#endif +#endif diff -ru _/minix/src/lib/ppc/rts/_setjmp.S minix/src/lib/ppc/rts/_setjmp.S --- _/minix/src/lib/ppc/rts/_setjmp.S 2006-08-14 22:04:20.000000000 +0900 +++ minix/src/lib/ppc/rts/_setjmp.S 2010-09-11 00:00:00.000000000 +0900 @@ -10,6 +10,7 @@ # int setjmp(my_jmp_buf _env, int _savemask); # _GLOBAL_F(__setjmp) +#if 0 addi R3, R3, -4 # update address in R3 so we can use stwu # note _savemask is ignored for now. @@ -38,6 +39,34 @@ _SAVE_2FPR(F30, R3) li R3, 0 # setjmp always return 0 blr +#else /* patch */ +#if defined(__arm__) +#define OFFSET(a) ((a) * 4 + 8) + add r0, r0, #OFFSET(0) + stmia r0!, {r4-r11, sp, lr} + mov r0, #0 + mov pc, lr +#elif defined(__mips__) +#define OFFSET(a) ((a) * 4 + 8) + .set at + .set reorder + sw $16, OFFSET(0)($4) + sw $17, OFFSET(1)($4) + sw $18, OFFSET(2)($4) + sw $19, OFFSET(3)($4) + sw $20, OFFSET(4)($4) + sw $21, OFFSET(5)($4) + sw $22, OFFSET(6)($4) + sw $23, OFFSET(7)($4) + sw $sp, OFFSET(8)($4) + sw $fp, OFFSET(9)($4) + sw $ra, OFFSET(10)($4) + move $2, $0 + jr $ra +#else +#error __setjmp +#endif +#endif diff -ru _/minix/src/lib/ppc/rts/brksize.S minix/src/lib/ppc/rts/brksize.S --- _/minix/src/lib/ppc/rts/brksize.S 2006-09-07 00:12:16.000000000 +0900 +++ minix/src/lib/ppc/rts/brksize.S 2010-05-11 00:00:00.000000000 +0900 @@ -6,5 +6,10 @@ /* define global label to data section. */ .section .data +#if 0 _GLOBAL_O(_brksize) .long (__bss_end) _GLOBAL_O(__brksize) .long (__bss_end) +#else /* patch */ +_GLOBAL_O(_brksize) .long (_end) +_GLOBAL_O(__brksize) .long (_end) +#endif diff -ru _/minix/src/lib/ppc/rts/crtso.S minix/src/lib/ppc/rts/crtso.S --- _/minix/src/lib/ppc/rts/crtso.S 2006-08-14 22:04:20.000000000 +0900 +++ minix/src/lib/ppc/rts/crtso.S 2010-09-11 00:00:00.000000000 +0900 @@ -16,11 +16,15 @@ #include #include +#if 0 .extern environ, __data_end +#else /* patch */ +#endif # using this section (crtso) in combination with util.lds makes sure it # is put at text 0x0. # +#if 0 .section .crtso .align 2 .globl crtso @@ -65,6 +69,29 @@ # normaly one would restore and delete the function stack frame here. trap # force a trap if exit fails +#else /* patch */ +_GLOBAL_F(crtso) +#if defined(__arm__) + mov r0, sp + ldr r1, =_edata + sub sp, sp, #MINIX_ARGUMENT /* ToDo: stack alignment */ + bl crtso_core +0: + b 0b /* ToDo: exit failure */ +#elif defined(__mips__) + .set at + .set reorder + move $4, $sp + la $5, _edata + addiu $sp, $sp, -MINIX_ARGUMENT /* ToDo: stack alignment */ + la $2, crtso_core + jalr $2 +0: + b 0b /* ToDo: exit failure */ +#else +#error crtso +#endif +#endif # Does not work for the powerpc, (iig how I use it.) @@ -73,11 +100,17 @@ # .long 0 # Separate I&D: *NULL == 0 # Also keeps the first string in the # program from appearing at location 0! +#if 0 .section .data _GLOBAL_O(_penviron) .long _penvp # Pointer to environ, or hidden pointer +#else /* patch */ +#endif +#if 0 .section .bss .comm _penvp, 4 # Hidden environment vector .comm _fpu_present, 4 # FPU present flag +#else /* patch */ +#endif diff -ru _/minix/src/lib/ppc/rts/ipc.S minix/src/lib/ppc/rts/ipc.S --- _/minix/src/lib/ppc/rts/ipc.S 2006-09-16 18:12:24.000000000 +0900 +++ minix/src/lib/ppc/rts/ipc.S 2010-05-11 00:00:00.000000000 +0900 @@ -16,43 +16,58 @@ #*========================================================================*# # _PROTOTYPE( int echo, (message *m_ptr)); _GLOBAL_F(_echo) # echo +#if 0 li R5, 0 # init to 0 mr R4, R3 # R3, contains the message pointer, copy to R4 li R3, ECHO # R3, needs to be the action. sc # preform the system call blr +#else /* patch */ +#endif # _PROTOTYPE( int notify, (int dest)); _GLOBAL_F(_notify) # notify +#if 0 li R5, 0 mr R4, R3 li R3, NOTIFY sc blr +#else /* patch */ +#endif # _PROTOTYPE( int sendrec, (int src_dest, message *m_ptr)); _GLOBAL_F(_sendrec) # send and recieve +#if 0 mr R5, R4 mr R4, R3 li R3, SENDREC sc blr +#else /* patch */ +#endif # _PROTOTYPE( int receive, (int src, message *m_ptr)); _GLOBAL_F(_receive) # recieve +#if 0 mr R5, R4 mr R4, R3 li R3, RECEIVE sc blr +#else /* patch */ +#endif # _PROTOTYPE( int send, (int dest, message *m_ptr)); _GLOBAL_F(_send) # send +#if 0 mr R5, R4 # move message ptr to R5 mr R4, R3 # move dest number to R4 li R3, SEND # we do a send. sc blr +#else /* patch */ +#endif /* these seem to be gone in 3.1.3rc1 diff -ru _/minix/src/lib/ppc/syscall/Makefile minix/src/lib/ppc/syscall/Makefile --- _/minix/src/lib/ppc/syscall/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/ppc/syscall/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -21,13 +21,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/regex/Makefile minix/src/lib/regex/Makefile --- _/minix/src/lib/regex/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/regex/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -41,13 +41,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/stdio/Makefile minix/src/lib/stdio/Makefile --- _/minix/src/lib/stdio/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/stdio/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -21,13 +21,18 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/syslib/Makefile minix/src/lib/syslib/Makefile --- _/minix/src/lib/syslib/Makefile 2006-09-24 19:30:02.000000000 +0900 +++ minix/src/lib/syslib/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -28,14 +28,19 @@ # - no standaard include directory # - system include # - own include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc # -isystem $(ICC) # the compiler C flages +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + # linker flages # LDFLAGS_GLOBAL := -m elf32ppc diff -ru _/minix/src/lib/sysutil/Makefile minix/src/lib/sysutil/Makefile --- _/minix/src/lib/sysutil/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/sysutil/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -22,11 +22,16 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/lib/sysutil/param.c minix/src/lib/sysutil/param.c --- _/minix/src/lib/sysutil/param.c 2006-09-09 03:39:30.000000000 +0900 +++ minix/src/lib/sysutil/param.c 2010-06-11 00:00:00.000000000 +0900 @@ -70,6 +70,12 @@ * the machine is. */ char* a = get_value_key(params, value, key); +#if 0 +#else /* patch */ + if (a == NULL) { + return -1; + } +#endif /* The powerpc key values should always be of the * form (IRQ,address,size) diff -ru _/minix/src/lib/timers/Makefile minix/src/lib/timers/Makefile --- _/minix/src/lib/timers/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/lib/timers/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -22,11 +22,16 @@ # compiler flags for a library file CFLAGS_ASSM := -D__ASSEMBLY__ -D__LIBRARY__ -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc +#CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata CFLAGS := -D_MINIX -D_POSIX_SOURCE -D_EM_WSIZE=4 \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes\ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata + -Wall -Wstrict-prototypes\ + -Wno-trigraphs -ffreestanding \ + MAKELIB := $(LIBRARYDIR)/$(LIBRARY) diff -ru _/minix/src/servers/dbg/Makefile minix/src/servers/dbg/Makefile --- _/minix/src/servers/dbg/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/servers/dbg/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -21,20 +21,29 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a +#STDLIBS := \ +#$(MINIX_SOURCE)/stdlib/libc.a \ +#$(MINIX_SOURCE)/stdlib/libppc.a \ +#$(MINIX_SOURCE)/stdlib/libgcc.a STDLIBS := \ -$(MINIX_SOURCE)/stdlib/libc.a \ -$(MINIX_SOURCE)/stdlib/libppc.a \ -$(MINIX_SOURCE)/stdlib/libgcc.a +$(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ +# -mno-sdata -fno-builtin -mno-altivec -static-libgcc CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_SYSTEM -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs -ffreestanding \ - -mno-sdata -fno-builtin -mno-altivec -static-libgcc + -Wall -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary @@ -44,7 +53,8 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(SERVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 4kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/servers/ds/Makefile minix/src/servers/ds/Makefile --- _/minix/src/servers/ds/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/servers/ds/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -21,15 +21,23 @@ STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall \ +# -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata \ +# -fno-builtin -mno-altivec CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall \ - -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata \ - -fno-builtin -mno-altivec + -Wall \ + -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(SERVER) @@ -38,7 +46,8 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(SERVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 16k elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/servers/fs/Makefile minix/src/servers/fs/Makefile --- _/minix/src/servers/fs/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/servers/fs/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -42,19 +42,28 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a -STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ - $(MINIX_SOURCE)/stdlib/libgcc.a +#STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a \ +# $(MINIX_SOURCE)/stdlib/libgcc.a +STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall \ +# -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata \ +# -fno-builtin -mno-altivec CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall \ - -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata \ - -fno-builtin -mno-altivec + -Wall \ + -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary @@ -64,7 +73,8 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(SERVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 265k elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/servers/fs/dmap.c minix/src/servers/fs/dmap.c --- _/minix/src/servers/fs/dmap.c 2006-09-01 04:14:58.000000000 +0900 +++ minix/src/servers/fs/dmap.c 2010-06-11 00:00:00.000000000 +0900 @@ -210,7 +210,11 @@ * the boot monitor. */ char driver[16]; +#if 0 char *controller = "c##"; +#else /* patch */ + char controller[] = "c##"; +#endif int nr, major = -1; int i,s; struct dmap *dp; diff -ru _/minix/src/servers/fs/exec.c minix/src/servers/fs/exec.c --- _/minix/src/servers/fs/exec.c 2006-09-07 03:17:46.000000000 +0900 +++ minix/src/servers/fs/exec.c 2010-06-11 00:00:00.000000000 +0900 @@ -28,12 +28,21 @@ #include "param.h" #include "super.h" +#if 0 FORWARD _PROTOTYPE( int exec_newmem, (int proc_e, vir_bytes text_bytes, vir_bytes data_bytes, vir_bytes bss_bytes, vir_bytes tot_bytes, vir_bytes frame_len, int sep_id, Dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname, int new_uid, int new_gid, vir_bytes *stack_topp, int *load_textp, int *allow_setuidp) ); +#else /* patch */ +FORWARD _PROTOTYPE( int exec_newmem, (int proc_e, vir_bytes text_bytes, + vir_bytes data_bytes, vir_bytes bss_bytes, vir_bytes tot_bytes, + vir_bytes frame_len, int sep_id, + Dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname, + int new_uid, int new_gid, + vir_bytes *stack_topp, int *load_textp, int *allow_setuidp, vir_bytes *pc) ); +#endif FORWARD _PROTOTYPE( int read_header, (struct inode *rip, int *sep_id, vir_bytes *text_bytes, vir_bytes *data_bytes, vir_bytes *bss_bytes, phys_bytes *tot_bytes, vir_bytes *pc, @@ -44,8 +53,13 @@ vir_bytes *stk_bytes, char *arg, int replace) ); FORWARD _PROTOTYPE( void patch_ptr, (char stack[ARG_MAX], vir_bytes base) ); +#if 0 FORWARD _PROTOTYPE( int read_seg, (struct inode *rip, off_t off, int proc_e, int seg, phys_bytes seg_bytes) ); +#else /* patch */ +FORWARD _PROTOTYPE( int read_seg, (struct inode *rip, off_t off, + int proc_e, int seg, phys_bytes seg_bytes, phys_bytes seg_base) ); +#endif FORWARD _PROTOTYPE( void clo_exec, (struct fproc *rfp) ); #define ESCRIPT (-2000) /* Returned by read_header for a #! script. */ @@ -185,9 +199,15 @@ } /* note this does sendrec with PM to allocate memory for new process. */ +#if 0 r= exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, frame_len, sep_id, rip->i_dev, rip->i_num, rip->i_ctime, progname, new_uid, new_gid, &stack_top, &load_text, &allow_setuid); +#else /* patch */ + r= exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, + frame_len, sep_id, rip->i_dev, rip->i_num, rip->i_ctime, + progname, new_uid, new_gid, &stack_top, &load_text, &allow_setuid, &pc); +#endif if (r != OK) { printf("pm_exec: exec_newmap failed: %d\n", r); @@ -211,13 +231,21 @@ debug("FS: loading text... %d bytes.\n", text_bytes); /* Read in text and data segments. */ if (load_text) { +#if 0 r= read_seg(rip, off, proc_e, T, text_bytes); +#else /* patch */ + r= read_seg(rip, off, proc_e, T, text_bytes, pc); +#endif } debug("done.\n"); debug("FS: loading data... %d bytes.\n", data_bytes); off += text_bytes; if (r == OK) +#if 0 r= read_seg(rip, off, proc_e, D, data_bytes); +#else /* patch */ + r= read_seg(rip, off, proc_e, D, data_bytes, pc + text_bytes); +#endif debug("done.\n"); put_inode(rip); @@ -246,9 +274,15 @@ /*===========================================================================* * exec_newmem * *===========================================================================*/ +#if 0 PRIVATE int exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, frame_len, sep_id, st_dev, st_ino, st_ctime, progname, new_uid, new_gid, stack_topp, load_textp, allow_setuidp) +#else /* patch */ +PRIVATE int exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, + frame_len, sep_id, st_dev, st_ino, st_ctime, progname, + new_uid, new_gid, stack_topp, load_textp, allow_setuidp, pc) +#endif int proc_e; vir_bytes text_bytes; vir_bytes data_bytes; @@ -265,6 +299,10 @@ vir_bytes *stack_topp; int *load_textp; int *allow_setuidp; +#if 0 +#else /* patch */ +vir_bytes *pc; +#endif { int r; struct exec_newmem e; @@ -287,6 +325,10 @@ m.m_type= EXEC_NEWMEM; m.EXC_NM_PROC= proc_e; m.EXC_NM_PTR= (char *)&e; +#if 0 +#else /* patch */ + m.m1_p2 = (void *)*pc; +#endif r= sendrec(PM_PROC_NR, &m); if (r != OK) return r; @@ -296,6 +338,10 @@ *stack_topp= m.m1_i1; *load_textp= !!(m.m1_i2 & EXC_NM_RF_LOAD_TEXT); *allow_setuidp= !!(m.m1_i2 & EXC_NM_RF_ALLOW_SETUID); +#if 0 +#else /* patch */ + *pc = (vir_bytes)m.m1_p2; +#endif debug("FS: exec_newmem: stack_top = 0x%x\n", *stack_topp); debug("FS: exec_newmem: load_text = %d\n", *load_textp); @@ -566,12 +612,20 @@ /*===========================================================================* * read_seg * *===========================================================================*/ +#if 0 PRIVATE int read_seg(rip, off, proc_e, seg, seg_bytes) +#else /* patch */ +PRIVATE int read_seg(rip, off, proc_e, seg, seg_bytes, seg_base) +#endif struct inode *rip; /* inode descriptor to read from */ off_t off; /* offset in file */ int proc_e; /* process number (endpoint) */ int seg; /* T, D, or S */ phys_bytes seg_bytes; /* how much is to be transferred? */ +#if 0 +#else /* patch */ +phys_bytes seg_base; +#endif { /* * The byte count on read is usually smaller than the segment count, because @@ -589,7 +643,11 @@ return EIO; block_size= rip->i_sp->s_block_size; +#if 0 seg_off= 0; +#else /* patch */ + seg_off= seg_base; +#endif for (o= off - (off % block_size); o < off+seg_bytes; o += block_size) { diff -ru _/minix/src/servers/init/Makefile minix/src/servers/init/Makefile --- _/minix/src/servers/init/Makefile 2006-09-24 19:27:06.000000000 +0900 +++ minix/src/servers/init/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -18,19 +18,28 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a +#STDLIBS := \ +#$(MINIX_SOURCE)/stdlib/libc.a \ +#$(MINIX_SOURCE)/stdlib/libppc.a STDLIBS := \ -$(MINIX_SOURCE)/stdlib/libc.a \ -$(MINIX_SOURCE)/stdlib/libppc.a +$(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs \ +# -ffreestanding -mno-sdata -fno-builtin -mno-altivec CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs \ - -ffreestanding -mno-sdata -fno-builtin -mno-altivec + -Wall -Wstrict-prototypes \ + -Wno-trigraphs \ + -ffreestanding # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(SERVER) @@ -39,7 +48,8 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(SERVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 16kw elf32/$@ aout/$@ # clean up local files diff -ru _/minix/src/servers/is/Makefile minix/src/servers/is/Makefile --- _/minix/src/servers/is/Makefile 2006-09-24 21:01:40.000000000 +0900 +++ minix/src/servers/is/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -28,14 +28,21 @@ # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ +# -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ +# -fomit-frame-pointer -Wno-trigraphs \ +# -ffreestanding -mno-sdata -fno-builtin -mno-altivec CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D_POSIX_SOURCE -D__minix \ - -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes \ - -fomit-frame-pointer -Wno-trigraphs \ - -ffreestanding -mno-sdata -fno-builtin -mno-altivec + -Wall -Wstrict-prototypes \ + -Wno-trigraphs \ + -ffreestanding # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary @@ -45,9 +52,10 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(SERVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 256w elf32/$@ aout/$@ - @cp -v aout/$@ $(MINIX_FS)/sbin/$@ +# @cp -v aout/$@ $(MINIX_FS)/sbin/$@ # clean up local files .PHONY: clean diff -ru _/minix/src/servers/pm/Makefile minix/src/servers/pm/Makefile --- _/minix/src/servers/pm/Makefile 2006-09-24 19:36:08.000000000 +0900 +++ minix/src/servers/pm/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -33,15 +33,23 @@ STDLIBS := $(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D__minix \ +# -mpowerpc -m32 -O3 -Wall \ +# -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata \ +# -fno-builtin -mno-altivec CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D__minix \ - -mpowerpc -m32 -O3 -Wall \ - -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata \ - -fno-builtin -mno-altivec + -Wall \ + -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(SERVER) @@ -50,7 +58,8 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(SERVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @echo $(MU) @elf2aout -v -S 128k elf32/$@ aout/$@ diff -ru _/minix/src/servers/pm/exec.c minix/src/servers/pm/exec.c --- _/minix/src/servers/pm/exec.c 2006-09-07 03:15:28.000000000 +0900 +++ minix/src/servers/pm/exec.c 2010-06-11 00:00:00.000000000 +0900 @@ -172,6 +172,11 @@ mp->mp_reply.reply_res3 |= EXC_NM_RF_LOAD_TEXT; if (allow_setuid) mp->mp_reply.reply_res3 |= EXC_NM_RF_ALLOW_SETUID; +#if 0 +#else /* patch */ + rmp->pc = (vir_bytes)m_in.m1_p2; + mp->mp_reply.m1_p2 = (void *)(rmp->mp_seg[T].mem_vir * CLICK_SIZE); +#endif return OK; } @@ -246,7 +251,11 @@ debug("going to tell kernel.\n"); new_sp= (char *)rmp->mp_procargs; +#if 0 pc= 0; /* for now */ +#else /* patch */ + pc= rmp->pc; +#endif r= sys_exec(rmp->mp_endpoint, new_sp, rmp->mp_name, pc); if (r != OK) panic(__FILE__, "sys_exec failed", r); diff -ru _/minix/src/servers/pm/main.c minix/src/servers/pm/main.c --- _/minix/src/servers/pm/main.c 2006-09-12 02:53:34.000000000 +0900 +++ minix/src/servers/pm/main.c 2010-05-11 00:00:00.000000000 +0900 @@ -524,7 +524,11 @@ base = (base + CLICK_SIZE-1) & ~(long)(CLICK_SIZE-1); limit &= ~(long)(CLICK_SIZE-1); if (limit <= base) continue; +#if 0 memp->base = base >> CLICK_SHIFT; +#else /* patch */ + memp->base = (unsigned long)base >> CLICK_SHIFT; +#endif memp->size = (limit - base) >> CLICK_SHIFT; } } diff -ru _/minix/src/servers/pm/misc.c minix/src/servers/pm/misc.c --- _/minix/src/servers/pm/misc.c 2006-09-12 04:02:14.000000000 +0900 +++ minix/src/servers/pm/misc.c 2010-11-11 00:00:00.000000000 +0900 @@ -49,7 +49,11 @@ #if __powerpc "powerpc", #else +#if 0 #error "oops, no 'uname -mk'" +#else /* patch */ + "", +#endif #endif /* #if __powerpc */ #endif /* #if __i386 */ }; diff -ru _/minix/src/servers/pm/mproc.h minix/src/servers/pm/mproc.h --- _/minix/src/servers/pm/mproc.h 2006-08-12 23:40:54.000000000 +0900 +++ minix/src/servers/pm/mproc.h 2010-06-11 00:00:00.000000000 +0900 @@ -60,6 +60,10 @@ vir_bytes mp_exec_path_len; /* Length of path (including nul) */ char *mp_exec_frame; /* Arguments */ vir_bytes mp_exec_frame_len; /* Length of arguments */ +#if 0 +#else /* patch */ + vir_bytes pc; +#endif /* Scheduling priority. */ signed int mp_nice; /* nice is PRIO_MIN..PRIO_MAX, standard 0. */ diff -ru _/minix/src/servers/rs/Makefile minix/src/servers/rs/Makefile --- _/minix/src/servers/rs/Makefile 2006-09-24 21:02:02.000000000 +0900 +++ minix/src/servers/rs/Makefile 2010-09-11 00:00:00.000000000 +0900 @@ -25,20 +25,30 @@ $(MINIX_SOURCE)/syslib/libsys.a \ $(MINIX_SOURCE)/syslib/libtimers.a +#STDLIBS := \ +#$(MINIX_SOURCE)/stdlib/libc.a \ +#$(MINIX_SOURCE)/stdlib/libgcc.a STDLIBS := \ -$(MINIX_SOURCE)/stdlib/libc.a \ -$(MINIX_SOURCE)/stdlib/libgcc.a +$(MINIX_SOURCE)/stdlib/libc.a # include directory -INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#INCLUDE := -nostdinc -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +INCLUDE := -I$(MINIX_SOURCE)/include -I$(MINIX_SOURCE)/arch/ppc -I$(MINIX_SOURCE)/kernel +#CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D__minix \ +# -mpowerpc -m32 -O3 -Wall \ +# -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata \ +# -fno-builtin -mno-altivec CFLAGS := -D_EM_WSIZE=4 -D_MINIX -D__minix \ - -mpowerpc -m32 -O3 -Wall \ - -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata \ - -fno-builtin -mno-altivec + -Wall \ + -Wstrict-prototypes \ + -Wno-trigraphs -ffreestanding \ + # linker flages -LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +#LDFLAGS := -m elf32ppc -Bstatic -M -T $(LD_SCRIPT) +LDFLAGS = -Wl,-Map,elf32/$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/syslib/crtso.o +LDLIBS = -nostdlib -lgcc # build local binary all: $(SERVER) $(UTIL) @@ -48,12 +58,14 @@ $(SERVER): $(OBJECTS) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 16kw elf32/$@ aout/$@ $(UTIL): $(OBJECTS_UTIL) $(SYSLIBS) $(STDLIBS) - $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS_UTIL) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make +# $(LD) $(LDFLAGS) -o elf32/$@ $(OBJECTS_UTIL) $(SYSLIBS) $(STDLIBS) > misc/$@.last.make + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o elf32/$@ > misc/$@.last.make @elf2aout -v -S 4kw elf32/$@ $(MINIX_FS)/bin/$@ # clean up local files diff -ru _/minix/src/util/elf2aout/Makefile minix/src/util/elf2aout/Makefile --- _/minix/src/util/elf2aout/Makefile 2006-09-24 20:19:04.000000000 +0900 +++ minix/src/util/elf2aout/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -2,14 +2,14 @@ # # Used to convert the elf32 file to the simple a.out format Minix is using. -CC := $(MINIX_GCC) +#CC := $(MINIX_GCC) LD := ld AS := as CFLAGS_ASSM := -D__ASSEMBLY__ -D__KERNEL__ INCLUDE := -CFLAGS := -mpowerpc -m32 -O3 -Wall +#CFLAGS := -mpowerpc -m32 -O3 -Wall LIB := ../libabi/libabi.o @@ -25,11 +25,11 @@ elf2aout: elf2aout.o $(CC) $(CFLAGS) -o $@ $@.o $(LIB) - @cp -v $@ $(HOME)/bin +# @cp -v $@ $(HOME)/bin readaout: readaout.o $(CC) $(CFLAGS) -o $@ $@.o $(LIB) - @cp -v $@ $(HOME)/bin +# @cp -v $@ $(HOME)/bin clean: rm -vf elf2aout readaout *.o diff -ru _/minix/src/util/elf2aout/elf2aout.c minix/src/util/elf2aout/elf2aout.c --- _/minix/src/util/elf2aout/elf2aout.c 2006-08-16 20:06:38.000000000 +0900 +++ minix/src/util/elf2aout/elf2aout.c 2010-05-11 00:00:00.000000000 +0900 @@ -135,7 +135,11 @@ * Then .text and .text2 are placed to the selected output section. */ +#if 0 char* sections_text[] = { ".text", NULL }; +#else /* patch */ + char* sections_text[] = { ".text", ".rodata", NULL }; +#endif char* sections_data[] = { ".data", NULL }; char* sections_bss[] = { ".bss", NULL }; diff -ru _/minix/src/util/libabi/libabi.c minix/src/util/libabi/libabi.c --- _/minix/src/util/libabi/libabi.c 2006-08-16 20:06:38.000000000 +0900 +++ minix/src/util/libabi/libabi.c 2010-06-11 00:00:00.000000000 +0900 @@ -227,7 +227,11 @@ ah.a_version = 1; /* I call it version 1 :) */ /* This is strait forward. */ +#if 0 ah.a_text = info->text.size; +#else /* patch */ + ah.a_text = align(info->text.size, CLICK_SIZE); +#endif /* The data size is not, the recorded size in the file info, which is the * real data size in the elf32 file. The compiler sometimes aligns the bss @@ -237,8 +241,24 @@ * sections size is padded with zeros to fillup the space and make the * data and bss section touch. */ +#if 0 ah.a_data = align(info->data.size, CLICK_SIZE); /* this must be aligned */ +#else /* patch */ + if (info->data.size == 0) { + ah.a_data = 0; + } else { + ah.a_data = (long)info->data.addr + info->data.size - ((long)info->text.addr + ah.a_text); + } +#endif +#if 0 ah.a_bss = info->bss.size; /* the one empty section */ +#else /* patch */ + if (info->bss.size == 0) { + ah.a_bss = 0; + } else { + ah.a_bss = (long)info->bss.addr + info->bss.size - ((long)info->text.addr + ah.a_text + ah.a_data); + } +#endif ah.a_entry = (u32_t)info->entry; /* entry point. */ /* a_total is data + bss + (default) stack size */ @@ -285,6 +305,7 @@ wrote += rtn; } while( wrote < (info->text.size) && rtn != -1 ); total += wrote; +#if 0 /* write the data section */ wrote = 0; do { @@ -292,8 +313,14 @@ wrote += rtn; } while(wrote < (info->data.size) && rtn != -1); total += wrote; +#else /* patch */ +#endif /* XXX padding zero's to data section */ +#if 0 pad = ah.a_data - info->data.size; +#else /* patch */ + pad = ah.a_text - info->text.size + ah.a_data - info->data.size; +#endif for(; pad > 0; pad--) { if( fwrite("\0", 1, 1, aout) != 1 ) { printf("Error, could not pad data section at image file.\n"); @@ -301,6 +328,16 @@ } total++; } +#if 0 +#else /* patch */ + /* write the data section */ + wrote = 0; + do { + rtn = fwrite((elf32b + info->data.offset), 1, info->data.size, aout); + wrote += rtn; + } while(wrote < (info->data.size) && rtn != -1); + total += wrote; +#endif /* file is finished */ diff -ru _/minix/src/util/mkfs/Makefile minix/src/util/mkfs/Makefile --- _/minix/src/util/mkfs/Makefile 2006-09-24 20:15:48.000000000 +0900 +++ minix/src/util/mkfs/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -7,7 +7,7 @@ UTIL := mkffs # Programs -CC := $(MINIX_GCC) +#CC := $(MINIX_GCC) LD := ld AS := as @@ -20,10 +20,10 @@ OBJECTS := $(UTIL).o -CFLAGS := -D_EM_WSIZE=4 -mpowerpc -m32 -O3 -Wall \ - -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata \ - -fno-builtin -mno-altivec -static-libgcc +#CFLAGS := -D_EM_WSIZE=4 -mpowerpc -m32 -O3 -Wall \ +# -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata \ +# -fno-builtin -mno-altivec -static-libgcc # objects to form program. @@ -35,8 +35,9 @@ $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(UTIL): $(OBJECTS) - $(CC) $(CFLAGS) -o elf32/$@ $(OBJECTS) - @cp -v elf32/$@ $(HOME)/bin +# $(CC) $(CFLAGS) -o elf32/$@ $(OBJECTS) + $(CC) $(CFLAGS) -o $@ $(OBJECTS) +# @cp -v elf32/$@ $(HOME)/bin # clean up local files .PHONY: clean diff -ru _/minix/src/util/mkfs/mkffs.c minix/src/util/mkfs/mkffs.c --- _/minix/src/util/mkfs/mkffs.c 2006-09-24 23:11:32.000000000 +0900 +++ minix/src/util/mkfs/mkffs.c 2010-11-11 00:00:00.000000000 +0900 @@ -10,6 +10,11 @@ #include #include #include +#if 0 +#else /* patch */ +#define getline getline_ +#define ino_t m_ino_t +#endif #include "types.h" /* minix simple types all with m_ */ #include "limits.h" /* minix limits */ @@ -971,7 +976,11 @@ sup->s_magic = SUPER_V3; sup->s_block_size = block_size; sup->s_disk_version = 0; +#if 0 #define MAX_MAX_SIZE ((unsigned long) 0xffffffff) +#else /* patch */ +#define MAX_MAX_SIZE ((unsigned long) M_LONG_MAX) +#endif if(MAX_MAX_SIZE/block_size < zo) { sup->s_max_size = MAX_MAX_SIZE; } else { diff -ru _/minix/src/util/mkimage/Makefile minix/src/util/mkimage/Makefile --- _/minix/src/util/mkimage/Makefile 2006-09-24 20:17:52.000000000 +0900 +++ minix/src/util/mkimage/Makefile 2010-05-11 00:00:00.000000000 +0900 @@ -8,7 +8,7 @@ OBJECTS := ../libabi/libabi.o mkimage.o # Programs -CC := $(MINIX_GCC) +#CC := $(MINIX_GCC) LD := ld AS := as @@ -19,8 +19,8 @@ SLCC := `$(CC) -print-libgcc-file-name` SICC := `$(CC) -print-file-name=include` -CFLAGS := -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer \ - -Wno-trigraphs -ffreestanding -mno-sdata -fno-builtin -mno-altivec +#CFLAGS := -mpowerpc -m32 -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer \ +# -Wno-trigraphs -ffreestanding -mno-sdata -fno-builtin -mno-altivec all: $(UTIL) @@ -30,7 +30,7 @@ $(UTIL): $(OBJECTS) $(CC) $(CFLAGS) -o $@ $(OBJECTS) - @cp -v $@ $(HOME)/bin +# @cp -v $@ $(HOME)/bin # clean stuff up !! .PHONY: clean