diff -ru _/src/commands/ash/Makefile src/commands/ash/Makefile --- _/src/commands/ash/Makefile 2007-04-05 21:30:24.000000000 +0900 +++ src/commands/ash/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -16,10 +16,13 @@ bltin/echo.o bltin/expr.o bltin/operators.o bltin/regexp.o \ arith.o arith_lex.o -LEX=flex -YACC=/usr/bin/yacc +#LEX=flex +LEX=flex --noyywrap +#YACC=/usr/bin/yacc +YACC=byacc .c.o: - $(CC) $(CFLAGS) -c $< -o $@ +# $(CC) $(CFLAGS) -c $< -o $@ + $(MINIX_GCC) $(CFLAGS) -I$(MINIX_SOURCE)/include -c $< -o $@ # Enable this line to disable command line editing #EDIT=-DNO_HISTORY @@ -36,9 +39,12 @@ NO_JOBS=-DJOBS=0 MKB_NO_JOBS=-j -CPPFLAGS= -DSHELL -I. -D_MINIX $(EDIT) $(NO_PATHS_H) $(NO_JOBS) +#CPPFLAGS= -DSHELL -I. -D_MINIX $(EDIT) $(NO_PATHS_H) $(NO_JOBS) +CPPFLAGS= -DSHELL -I. -D_MINIX $(EDIT) $(NO_PATHS_H) $(NO_JOBS) -D__minix CFLAGS= $(OPT) $(CPPFLAGS) LIBS= $(EDITLIB) $(FLEXLIB) +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libedit.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc CLEANFILES= $(OBJS) \ arith.c arith_y.h arith_lex.c builtins.c builtins.h init.c \ @@ -49,22 +55,24 @@ all: sh sh: $(OBJS) - $(CC) $(CFLAGS) -fnone -o sh $(OBJS) $(LIBS) - install -S 136k sh +# $(CC) $(CFLAGS) -fnone -o sh $(OBJS) $(LIBS) + $(MINIX_GCC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 136k sh + elf2aout -v -S 136k $@.elf $@ install: /usr/bin/ash /usr/bin/sh /bin/sh /bin/bigsh /usr/bin/ash: sh - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/sh: /usr/bin/ash - install -l $? $@ +# install -l $? $@ /bin/sh: /usr/bin/ash - install -lcs $? $@ +# install -lcs $? $@ /bin/bigsh: /usr/bin/ash - install -S 6600k -lcs $? $@ +# install -S 6600k -lcs $? $@ clean: rm -f $(CLEANFILES) sh core diff -ru _/src/commands/simple/Makefile src/commands/simple/Makefile --- _/src/commands/simple/Makefile 2007-04-02 23:41:06.000000000 +0900 +++ src/commands/simple/Makefile 2010-12-11 00:00:00.000000000 +0900 @@ -1,10 +1,14 @@ # Makefile for commands/simple. -CFLAGS = -D_MINIX -D_POSIX_SOURCE +#CFLAGS = -D_MINIX -D_POSIX_SOURCE +CFLAGS = -D_MINIX -D_POSIX_SOURCE -I$(MINIX_SOURCE)/include SYS = ../.. SERVERS = ../../servers CCLD = $(CC) -i $(CFLAGS) -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc # This Makefile is large, but that is because it lists all actions that must # be taken to compile and install all the simple commands. If there were only @@ -217,675 +221,687 @@ all: $(ALL) add_route: add_route.c - $(CCLD) -o $@ add_route.c - @install -S 4kw $@ +# $(CCLD) -o $@ add_route.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# @install -S 4kw $@ + @elf2aout -v -S 4kw $@.elf $@ arp: arp.c $(CCLD) -o $@ arp.c - @install -S 4kw $@ +# @install -S 4kw $@ at: at.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ backup: backup.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ badblocks: badblocks.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ banner: banner.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ basename: basename.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ cal: cal.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ calendar: calendar.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ cat: cat.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ cdiff: cdiff.c $(CCLD) -o $@ $? - @install -S 28kw $@ +# @install -S 28kw $@ cdprobe: cdprobe.c $(CCLD) -o $@ $? - @install -S 28kw $@ +# @install -S 28kw $@ cgrep: cgrep.c $(CCLD) -o $@ $? - @install -S 5kw $@ +# @install -S 5kw $@ chmem: chmem.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ chmod: chmod.c $(CCLD) -o $@ $? - @install -S 16kw $@ +# @install -S 16kw $@ chown: chown.c $(CCLD) -o $@ $? - @install -S 16kw $@ +# @install -S 16kw $@ chroot: chroot.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ ci: ci.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ cksum: cksum.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ cleantmp: cleantmp.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ cmp: cmp.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ co: co.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ comm: comm.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ compress: compress.c $(CCLD) -o $@ $? - @install -S 450k $@ +# @install -S 450k $@ cp: cp.c $(CCLD) -o $@ $? - @install -S 32kw $@ +# @install -S 32kw $@ crc: crc.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ cut: cut.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ dd: dd.c $(CCLD) -o $@ $? - @install -S 20kw $@ +# @install -S 20kw $@ decomp16: decomp16.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ dev2name: dev2name.c - $(CCLD) -o $@ $? - @install -S 4kw $@ +# $(CCLD) -o $@ $? + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# @install -S 4kw $@ + @elf2aout -v -S 4kw $@.elf $@ devsize: devsize.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ df: df.c $(CCLD) -I$(SYS) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ dhrystone: dhrystone.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ diff: diff.c $(CCLD) -o $@ $? - @install -S 512kw $@ +# @install -S 512kw $@ dirname: dirname.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ du: du.c $(CCLD) -o $@ $? - @install -S 256kw $@ +# @install -S 256kw $@ dumpcore: dumpcore.c $(CCLD) -D_SYSTEM=1 -o $@ $? -lsysutil -lsys - @install -S 32k $@ +# @install -S 32k $@ ed: ed.c $(CCLD) -o $@ $? - @install -S 32kw $@ +# @install -S 32kw $@ eject: eject.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ env: env.c $(CCLD) -o $@ $? - @install -S 50k $@ +# @install -S 50k $@ expand: expand.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ factor: factor.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ fgrep: fgrep.c $(CCLD) -o $@ $? - @install -S 10kw $@ +# @install -S 10kw $@ file: file.c $(CCLD) -o $@ $? - @install -S 25kw $@ +# @install -S 25kw $@ find: find.c $(CCLD) -o $@ $? - @install -S 25kw $@ +# @install -S 25kw $@ finger: finger.c $(CCLD) -o $@ finger.c - @install -S 8kw $@ +# @install -S 8kw $@ fix: fix.c $(CCLD) -o $@ fix.c - @install -S 32kw $@ +# @install -S 32kw $@ fold: fold.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ fortune: fortune.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ fsck: fsck.c $(CCLD) -o $@ $? - @install -S 6144k $@ +# @install -S 6144k $@ fsck1: fsck1.c $(CCLD) -o $@ $? - @install -S 32kw $@ +# @install -S 32kw $@ getty: getty.c /usr/include/minix/config.h $(CCLD) -o $@ getty.c - @install -S 4kw $@ +# @install -S 4kw $@ gomoku: gomoku.c $(CCLD) -o $@ $? -lcurses - @install -S 8kw $@ +# @install -S 8kw $@ grep: grep.c $(CCLD) -o $@ $? - @install -S 32kw $@ +# @install -S 32kw $@ head: head.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ host: host.c $(CCLD) -wo -o $@ host.c - @install -S 4kw $@ +# @install -S 4kw $@ hostaddr: hostaddr.c $(CCLD) -o $@ hostaddr.c - @install -S 8kw $@ +# @install -S 8kw $@ id: id.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ ifconfig: ifconfig.c - $(CCLD) -o $@ ifconfig.c - @install -S 4kw $@ +# $(CCLD) -o $@ ifconfig.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# @install -S 4kw $@ + @elf2aout -v -S 4kw $@.elf $@ ifdef: ifdef.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ in.fingerd: in.fingerd.c $(CCLD) -o $@ in.fingerd.c - @install -S 4kw $@ +# @install -S 4kw $@ in.rshd: in.rshd.c $(CCLD) -o $@ in.rshd.c - @install -S 8kw $@ +# @install -S 8kw $@ installx: install.c # Note: avoided confict with 'install' rule. $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ intr: intr.c $(CCLD) -o $@ intr.c - @install -S 4kw $@ +# @install -S 4kw $@ irdpd: irdpd.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ isoread: isoread.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ join: join.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ kill: kill.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ last: last.c $(CCLD) -o $@ $? - @install -S 5kw $@ +# @install -S 5kw $@ leave: leave.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ life: life.c $(CCLD) -o $@ $? -lcurses - @install -S 15kw $@ +# @install -S 15kw $@ loadramdisk: loadramdisk.c $(CCLD) -o $@ $? - install -S 4kw $@ +# install -S 4kw $@ login: login.c $(CCLD) -o $@ $? - install -S 4kw $@ +# install -S 4kw $@ look: look.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ lp: lp.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ lpd: lpd.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ ls: ls.c $(CCLD) -o $@ $? - @install -S 20kw $@ +# @install -S 20kw $@ mail: mail.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ man: man.c $(CCLD) -o $@ $? - @install -S 10kw $@ +# @install -S 10kw $@ mesg: mesg.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ mkdir: mkdir.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ mkfifo: mkfifo.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ mkfs: mkfs.c $(CCLD) -o $@ $? - @install -S 25kw $@ +# @install -S 25kw $@ mknod: mknod.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ mkproto: mkproto.c $(CCLD) -o $@ $? - @install -S 20kw $@ +# @install -S 20kw $@ mkswap: mkswap.c $(CCLD) -I$(SYS) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ modem: modem.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ mount: mount.c $(CCLD) -o $@ $? - @install -S 12kw $@ +# @install -S 12kw $@ mt: mt.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ newroot: newroot.c - $(CCLD) -o $@ $? - @install -S 32kw $@ +# $(CCLD) -o $@ $? + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# @install -S 32kw $@ + @elf2aout -v -S 32kw $@.elf $@ nm: nm.c $(CCLD) -o $@ $? - @install -S 32kw $@ +# @install -S 32kw $@ nice: nice.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ nonamed: nonamed.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ od: od.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ passwd: passwd.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ paste: paste.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ ping: ping.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ pr: pr.c $(CCLD) -o $@ $? - @install -S 16kw $@ +# @install -S 16kw $@ pr_routes: pr_routes.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ progressbar: progressbar.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ prep: prep.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ printf: printf.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ printenv: printenv.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ printroot: printroot.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ proto: proto.c $(CCLD) -o $@ $? - @install -S 15kw $@ +# @install -S 15kw $@ pwd: pwd.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ pwdauth: pwdauth.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ ramdisk: ramdisk.c $(CCLD) -o $@ ramdisk.c - @install -S 4kw $@ +# @install -S 4kw $@ rarpd: rarpd.c $(CCLD) -o $@ rarpd.c - @install -S 4kw $@ +# @install -S 4kw $@ rcp: rcp.c $(CCLD) -o $@ rcp.c - @install -S 8kw $@ +# @install -S 8kw $@ rawspeed: rawspeed.c $(CCLD) -o $@ rawspeed.c - @install -S 512k $@ +# @install -S 512k $@ rdate: rdate.c $(CCLD) -o $@ rdate.c - @install -S 8kw $@ +# @install -S 8kw $@ rev: rev.c $(CCLD) -o $@ rev.c - @install -S 8kw $@ +# @install -S 8kw $@ readall: readall.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ readfs: readfs.c $(CCLD) -o $@ $? - @install -S 25kw $@ +# @install -S 25kw $@ remsync: remsync.c $(CCLD) -o $@ $? - @install -S 256k $@ +# @install -S 256k $@ rget: rget.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ rlogin: rlogin.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ rmdir: rmdir.c $(CCLD) -o $@ $? - @install -S 15kw $@ +# @install -S 15kw $@ rsh: rsh.c $(CCLD) -o $@ rsh.c - @install -S 8kw $@ +# @install -S 8kw $@ sed: sed.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ shar: shar.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ size: size.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ sleep: sleep.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ slip: slip.c $(CCLD) -o $@ $? - @install -S 20k $@ +# @install -S 20k $@ sort: sort.c $(CCLD) -o $@ $? - @install -S 30kw $@ +# @install -S 30kw $@ split: split.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ stat: stat.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ strings: strings.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ strip: strip.c $(CCLD) -o $@ $? - @install -S 8kw $@ +# @install -S 8kw $@ stty: stty.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ su: su.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ sum: sum.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ swapfs: swapfs.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ sync: sync.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ synctree: synctree.c $(CCLD) -o $@ -wo $? - install -S 256kw $@ +# install -S 256kw $@ sysenv: sysenv.c - $(CCLD) -o $@ -wo $? - @install -S 4kw $@ +# $(CCLD) -o $@ -wo $? + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# @install -S 4kw $@ + @elf2aout -v -S 4kw $@.elf $@ tail: tail.c $(CCLD) -o $@ $? - @install -S 16kw $@ +# @install -S 16kw $@ tar: tar.c $(CCLD) -o $@ $? - @install -S 256kw $@ +# @install -S 256kw $@ tcpd: tcpd.c $(CCLD) -o $@ -DPARANOID=0 tcpd.c - @install -S 8kw $@ +# @install -S 8kw $@ tcpdp: tcpd.c $(CCLD) -o $@ -DPARANOID=1 tcpd.c - @install -S 8kw $@ +# @install -S 8kw $@ tcpstat: tcpstat.c $(CCLD) -o $@ -I$(SERVERS) tcpstat.c - @install -S 8kw $@ +# @install -S 8kw $@ tee: tee.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ term: term.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ termcap: termcap.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ tget: tget.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ time: time.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ touch: touch.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ top: top.c $(CCLD) -o $@ $? -lcurses tr: tr.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ tsort: tsort.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ treecmp: treecmp.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ truncate: truncate.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ ttt: ttt.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ tty: tty.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ udpstat: udpstat.c $(CCLD) -o $@ -I$(SERVERS) $? - @install -S 32k $@ +# @install -S 32k $@ umount: umount.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ uname: uname.c /usr/include/minix/config.h $(CCLD) -o $@ uname.c - @install -S 4kw $@ +# @install -S 4kw $@ unexpand: unexpand.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ uniq: uniq.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ update: update.c $(CCLD) -o $@ $? - @install -S 2kw $@ +# @install -S 2kw $@ uud: uud.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ uue: uue.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ vol: vol.c $(CCLD) -o $@ $? - @install -S 80k $@ # note: '-S' is upper limit to 'vol -m' +# @install -S 80k $@ # note: '-S' is upper limit to 'vol -m' wc: wc.c - $(CCLD) -o $@ $? - @install -S 4kw $@ +# $(CCLD) -o $@ $? + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# @install -S 4kw $@ + @elf2aout -v -S 4kw $@.elf $@ which: which.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ who: who.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ whoami: whoami.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ write: write.c $(CCLD) -o $@ $? @@ -895,11 +911,11 @@ xargs: xargs.c $(CCLD) -o $@ $? - @install -S 16kw $@ +# @install -S 16kw $@ yes: yes.c $(CCLD) -o $@ $? - @install -S 4kw $@ +# @install -S 4kw $@ install: \ /usr/bin/add_route \ @@ -1118,611 +1134,611 @@ # /usr/bin/add_route: add_route - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/del_route: /usr/bin/add_route - install -l $? $@ +# install -l $? $@ /usr/bin/arp: arp - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/at: at - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/backup: backup - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/restore: /usr/bin/backup - install -l $? $@ +# install -l $? $@ /usr/bin/badblocks: badblocks - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/banner: banner - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/basename: basename - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cal: cal - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/calendar: calendar - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cat: cat - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cdiff: cdiff - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cdprobe: cdprobe - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cgrep: cgrep - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/chmem: chmem - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/chmod: chmod - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/chown: chown - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/chroot: chroot - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/chgrp: /usr/bin/chown - install -l $? $@ +# install -l $? $@ /usr/bin/ci: ci - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cksum: cksum - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cleantmp: cleantmp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cmp: cmp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/co: co - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/comm: comm - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/compress: compress - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/uncompress /usr/bin/zcat: /usr/bin/compress - install -l $? $@ +# install -l $? $@ /bin/cp: cp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cp: cp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/clone /usr/bin/cpdir \ /usr/bin/ln /usr/bin/mv /usr/bin/rm: /usr/bin/cp - install -l $? $@ +# install -l $? $@ /bin/ln /bin/mv /bin/rm: /bin/cp - install -l $? $@ +# install -l $? $@ /usr/bin/crc: crc - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/cut: cut - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/dd: dd - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/dev2name: dev2name - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/devsize: devsize - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/decomp16: decomp16 - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/df: df - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/dhrystone: dhrystone - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/diff: diff - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/dirname: dirname - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/du: du - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/dumpcore: dumpcore - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/ed: ed - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/eject: eject - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/env: env - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/expand: expand - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/factor: factor - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/fgrep: fgrep - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/file: file - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/find: find - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/finger: finger - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/fix: fix - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/fold: fold - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/fortune: fortune - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/fsck: fsck - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/fsck1: fsck1 - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/getty: getty - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/getty: getty - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/gomoku: gomoku - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/grep: grep - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/egrep: /usr/bin/grep - install -l $? $@ +# install -l $? $@ /usr/bin/head: head - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/host: host - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/hostaddr: hostaddr - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/id: id - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/ifconfig: ifconfig - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/ifdef: ifdef - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/in.fingerd: in.fingerd - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/in.rshd: in.rshd - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/install: installx - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/install: installx - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/intr: intr - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/irdpd: irdpd - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/isoread: isoread - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/isodir /usr/bin/isoinfo: /usr/bin/isoread - install -l $? $@ +# install -l $? $@ /usr/bin/join: join - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/kill: kill - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/last: last - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/uptime: /usr/bin/last - install -l $? $@ +# install -l $? $@ /usr/bin/leave: leave - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/life: life - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/loadramdisk: loadramdisk - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/login: login - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/look: look - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/lp: lp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/lpd: lpd - install -cs -o daemon -m 4755 $? $@ +# install -cs -o daemon -m 4755 $? $@ /usr/bin/ls: ls - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/ls: ls - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mail: mail - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/man: man - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mesg: mesg - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mkdir: mkdir - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mkfifo: mkfifo - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mkfs: mkfs - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mknod: mknod - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mkproto: mkproto - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mkswap: mkswap - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/modem: modem - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/mount: mount - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/mt: mt - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/newroot: newroot - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/nm: nm - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/nice: nice - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/nonamed: nonamed - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/od: od - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/passwd: passwd - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/chfn /usr/bin/chsh: /usr/bin/passwd - install -l $? $@ +# install -l $? $@ /usr/bin/paste: paste - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/ping: ping - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/pr: pr - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/pr_routes: pr_routes - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/progressbar: progressbar - install -cs -o root -m 755 $? $@ +# install -cs -o root -m 755 $? $@ /usr/bin/prep: prep - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/printf: printf - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/printenv: printenv - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/printroot: printroot - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/proto: proto - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/pwd: pwd - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/lib/pwdauth: pwdauth - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/ramdisk: ramdisk - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rarpd: rarpd - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rcp: rcp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rawspeed: rawspeed - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rdate: rdate - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/readall: readall - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/readlink: /usr/bin/stat - install -l $? $@ +# install -l $? $@ /usr/bin/readfs: readfs - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/remsync: remsync - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rev: rev - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rget: rget - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rput: /usr/bin/rget - install -l $? $@ +# install -l $? $@ /usr/bin/rlogin: rlogin - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rmdir: rmdir - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/rsh: rsh - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/sed: sed - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/sed: sed - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/shar: shar - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/size: size - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/sleep: sleep - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/slip: slip - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/sort: sort - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/split: split - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/stat: stat - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/fstat: /usr/bin/stat - install -l $? $@ +# install -l $? $@ /usr/bin/strings: strings - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/strip: strip - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/stty: stty - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/su: su - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/sum: sum - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/swapfs: swapfs - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/sync: sync - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/synctree: synctree - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/sysenv: sysenv - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/sysenv: sysenv - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tail: tail - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tar: tar - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tcpd: tcpd - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tcpdp: tcpdp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tcpstat: tcpstat - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tee: tee - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/term: term - install -cs -o bin -g uucp -m 2755 $? $@ +# install -cs -o bin -g uucp -m 2755 $? $@ /usr/bin/termcap: termcap - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tget: tget - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/time: time - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/top: top - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/touch: touch - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tr: tr - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/treecmp: treecmp - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/truncate: truncate - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tsort: tsort - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/ttt: ttt - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/tty: tty - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/udpstat: udpstat - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/umount: umount - install -cs -o root -m 4755 $? $@ +# install -cs -o root -m 4755 $? $@ /usr/bin/uname: uname - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/arch: /usr/bin/uname - install -l $? $@ +# install -l $? $@ /usr/bin/unexpand: unexpand - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/uniq: uniq - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/update: update - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/uud: uud - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/uudecode: /usr/bin/uud - install -l $? $@ +# install -l $? $@ /usr/bin/uue: uue - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/uuencode: /usr/bin/uue - install -l $? $@ +# install -l $? $@ /usr/bin/vol: vol - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/wc: wc - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/which: which - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/who: who - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/whoami: whoami - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/write: write - install -cs -o bin -g tty -m 2755 $? $@ +# install -cs -o bin -g tty -m 2755 $? $@ /usr/bin/writeisofs: writeisofs - install -cs -S 2M -o bin $? $@ +# install -cs -S 2M -o bin $? $@ /usr/bin/xargs: xargs - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /usr/bin/yes: yes - install -cs -o bin $? $@ +# install -cs -o bin $? $@ /bin/cat: /usr/bin/cat - install -lcs $? $@ +# install -lcs $? $@ /bin/fsck: /usr/bin/fsck - install -lcs $? $@ +# install -lcs $? $@ /bin/intr: /usr/bin/intr - install -lcs $? $@ +# install -lcs $? $@ /bin/mount: /usr/bin/mount - install -lcs $? $@ +# install -lcs $? $@ /bin/printroot: /usr/bin/printroot - install -lcs $? $@ +# install -lcs $? $@ /bin/pwd: /usr/bin/pwd - install -lcs $? $@ +# install -lcs $? $@ /bin/sync: /usr/bin/sync - install -lcs $? $@ +# install -lcs $? $@ /bin/umount: /usr/bin/umount - install -lcs $? $@ +# install -lcs $? $@ clean: rm -rf $(ALL) a.out core diff -ru _/src/commands/urlget/Makefile src/commands/urlget/Makefile --- _/src/commands/urlget/Makefile 2005-09-07 17:43:26.000000000 +0900 +++ src/commands/urlget/Makefile 2010-12-11 00:00:00.000000000 +0900 @@ -3,21 +3,27 @@ # 07/02/96 Initial Release Michael Temari, # -CFLAGS= -D_MINIX $(OPT) -LDFLAGS=-fnone +#CFLAGS= -D_MINIX $(OPT) +CFLAGS= -D_MINIX $(OPT) -I$(MINIX_SOURCE)/include +#LDFLAGS=-fnone +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc BINDIR= /usr/bin PROG= urlget LINK1= httpget LINK2= ftpget -CC=exec cc +#CC=exec cc +CC=exec $(MINIX_GCC) OBJS= urlget.o net.o all: $(PROG) $(PROG): $(OBJS) - $(CC) $(LDFLAGS) -o $@ $(OBJS) - install -S 4kw $@ +# $(CC) $(LDFLAGS) -o $@ $(OBJS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 4kw $@ + elf2aout -v -S 4kw $@.elf $@ clean: rm -f $(PROG) $(OBJS) @@ -28,9 +34,9 @@ install: $(BINDIR)/$(PROG) $(BINDIR)/$(LINK1) $(BINDIR)/$(LINK2) $(BINDIR)/$(PROG): $(PROG) - install -c $? $@ +# install -c $? $@ $(BINDIR)/$(LINK1) $(BINDIR)/$(LINK2): $(BINDIR)/$(PROG) - install -l $? $@ +# install -l $? $@ $(OBJS): net.h diff -ru _/src/drivers/Makefile src/drivers/Makefile --- _/src/drivers/Makefile 2007-01-13 01:35:04.000000000 +0900 +++ src/drivers/Makefile 2010-12-11 00:00:00.000000000 +0900 @@ -17,29 +17,29 @@ all install depend clean: cd ./libdriver && $(MAKE) $@ cd ./tty && $(MAKE) $@ - cd ./at_wini && $(MAKE) $@ - cd ./floppy && $(MAKE) $@ - cd ./printer && $(MAKE) $@ - cd ./rtl8139 && $(MAKE) $@ - cd ./fxp && $(MAKE) $@ - cd ./dpeth && $(MAKE) $@ +# cd ./at_wini && $(MAKE) $@ +# cd ./floppy && $(MAKE) $@ +# cd ./printer && $(MAKE) $@ +# cd ./rtl8139 && $(MAKE) $@ +# cd ./fxp && $(MAKE) $@ +# cd ./dpeth && $(MAKE) $@ cd ./log && $(MAKE) $@ cd ./bios_wini && $(MAKE) $@ - cd ./random && $(MAKE) $@ - cd ./readclock && $(MAKE) $@ - cd ./dp8390 && $(MAKE) $@ - cd ./sb16 && $(MAKE) $@ +# cd ./random && $(MAKE) $@ +# cd ./readclock && $(MAKE) $@ +# cd ./dp8390 && $(MAKE) $@ +# cd ./sb16 && $(MAKE) $@ cd ./lance && $(MAKE) $@ - cd ./pci && $(MAKE) $@ - cd ./ti1225 && $(MAKE) $@ +# cd ./pci && $(MAKE) $@ +# cd ./ti1225 && $(MAKE) $@ cd ./memory && $(MAKE) $@ # Must be last for ramdisk image image: cd ./libdriver && $(MAKE) build cd ./tty && $(MAKE) build - cd ./at_wini && $(MAKE) build - cd ./floppy && $(MAKE) build +# cd ./at_wini && $(MAKE) build +# cd ./floppy && $(MAKE) build cd ./bios_wini && $(MAKE) build cd ./log && $(MAKE) build - cd ./pci && $(MAKE) build +# cd ./pci && $(MAKE) build cd ./memory && $(MAKE) build # Must be last for ramdisk image diff -ru _/src/drivers/bios_wini/Makefile src/drivers/bios_wini/Makefile --- _/src/drivers/bios_wini/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/drivers/bios_wini/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,7 +2,8 @@ DRIVER = bios_wini # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys m = $i/minix @@ -11,9 +12,14 @@ # programs, flags, etc. MAKE = exec make -CC = exec cc -CFLAGS = -I$i $(CPROFILE) -LDFLAGS = -i -L../libdriver +#CC = exec cc +CC = exec $(MINIX_GCC) +#CFLAGS = -I$i $(CPROFILE) +CFLAGS = -I$i $(CPROFILE) -I../../../yanakernel0prototype/yanakernel0a/sample/$(MINIX_CHIP)/common +#LDFLAGS = -i -L../libdriver +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +#LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libtimers.a ../libdriver/libdriver.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a ../libdriver/libdriver.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libtimers.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -lsys -ltimers -ldriver OBJ = bios_wini.o @@ -21,13 +27,15 @@ # build local binary all build: $(DRIVER) $(DRIVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 8k $(DRIVER) +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 8k $(DRIVER) + elf2aout -v -S 8k $@.elf $@ # install with other drivers install: /sbin/$(DRIVER) /sbin/$(DRIVER): $(DRIVER) - install -o root -cs $? $@ +# install -o root -cs $? $@ # clean up local files clean: @@ -37,5 +45,5 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/drivers/bios_wini/bios_wini.c src/drivers/bios_wini/bios_wini.c --- _/src/drivers/bios_wini/bios_wini.c 2007-02-08 01:22:20.000000000 +0900 +++ src/drivers/bios_wini/bios_wini.c 2010-12-11 00:00:00.000000000 +0900 @@ -29,6 +29,12 @@ #include #include #include +#if 0 +#else /* patch */ +#undef TESTMIPS32 +#undef TESTMIPS64 +#include "device.h" +#endif #define ME "BIOS_WINI" @@ -103,6 +109,13 @@ { long v; struct sigaction sa; +#if 0 +#else /* patch */ + int index; + vir_bytes off; + u16_t seg; + sys_segctl(&index, &seg, &off, DEVICE_DISK_OFFSET, DEVICE_DISK_BUFFER + DEVICE_DISK_BUFFER_LEN - DEVICE_DISK_OFFSET); +#endif sa.sa_handler = SIG_MESS; sigemptyset(&sa.sa_mask); @@ -124,6 +137,7 @@ PRIVATE struct device *w_prepare(device) int device; { +#if 0 /* Prepare for I/O on a device. */ if (device < NR_MINORS) { /* d0, d0p[0-3], d1, ... */ @@ -141,6 +155,15 @@ if (w_drive >= MAX_DRIVES || !w_wn->present) return NIL_DEV; 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 } /*===========================================================================* @@ -235,9 +258,13 @@ errors = 0; +#if 0 i13e_rw_off= bios_buf_size-sizeof(i13e_rw); rem_buf_size= (i13e_rw_off & ~SECTOR_MASK); assert(rem_buf_size != 0); +#else /* patch */ + rem_buf_size = DEVICE_DISK_BUFFER_LEN; +#endif while (nr_req > 0) { /* How many bytes to transfer? */ @@ -253,8 +280,11 @@ if ((nbytes & SECTOR_MASK) != 0) return(EINVAL); /* Which block on disk and how close to EOF? */ +#if 0 if (position >= dv_size) return(OK); /* At EOF */ if (position + nbytes > dv_size) nbytes = dv_size - position; +#else /* patch */ +#endif block = div64u(add64ul(w_dv->dv_base, position), SECTOR_SIZE); /* Degrade to per-sector mode if there were errors. */ @@ -267,10 +297,17 @@ chunk = iov->iov_size; if (count + chunk > nbytes) chunk = nbytes - count; assert(chunk <= rem_buf_size); +#if 0 r= my_vircopy(proc_nr, safe ? GRANT_SEG : D, (vir_bytes) iop->iov_addr, SYSTEM, D, bios_buf_vir+count, vir_offset, chunk); +#else /* patch */ + r= my_vircopy(proc_nr, safe ? GRANT_SEG : D, + (vir_bytes) iop->iov_addr, + NONE, PHYS_SEG, DEVICE_DISK_BUFFER+count, + vir_offset, chunk); +#endif if (r != OK) panic(ME, "copy failed", r); count += chunk; @@ -278,6 +315,7 @@ } /* Do the transfer */ +#if 0 if (wn->int13ext) { i13e_rw.len = 0x10; i13e_rw.res1 = 0; @@ -314,12 +352,29 @@ reg86.u.b.dh = head; reg86.u.b.dl = wn->drive_id; } +#else /* patch */ + *(volatile unsigned int *)DEVICE_DISK_OFFSET = ex64lo(add64u(position, w_dv->dv_base)); + *(volatile unsigned int *)DEVICE_DISK_OFFSET_HIGH32 = ex64hi(add64u(position, w_dv->dv_base)); + *(volatile unsigned int *)DEVICE_DISK_ID = w_drive; +#endif +#if 0 r= sys_int86(®86); if (r != OK) panic(ME, "BIOS call failed", r); +#else /* patch */ + if (opcode == DEV_GATHER_S) { + *(volatile unsigned int *)DEVICE_DISK_START_OPERATION = DEVICE_DISK_OPERATION_READ; + } else { + *(volatile unsigned int *)DEVICE_DISK_START_OPERATION = DEVICE_DISK_OPERATION_WRITE; + } +#endif +#if 0 if (reg86.u.w.f & 0x0001) { +#else /* patch */ + if (*(volatile unsigned int *)DEVICE_DISK_STATUS == 0) { +#endif /* An error occurred, try again sector by sector unless */ if (++errors == 2) return(EIO); continue; @@ -332,9 +387,15 @@ chunk = iov->iov_size; if (count + chunk > nbytes) chunk = nbytes - count; assert(chunk <= rem_buf_size); +#if 0 r = my_vircopy(SYSTEM, D, bios_buf_vir+count, proc_nr, safe ? GRANT_SEG : D, iop->iov_addr, vir_offset, chunk); +#else /* patch */ + r = my_vircopy(NONE, PHYS_SEG, DEVICE_DISK_BUFFER+count, + proc_nr, safe ? GRANT_SEG : D, + iop->iov_addr, vir_offset, chunk); +#endif if (r != OK) panic(ME, "sys_vircopy failed", r); count += chunk; @@ -383,7 +444,10 @@ if (w_wn->open_ct++ == 0) { /* Partition the disk. */ +#if 0 partition(&w_dtab, w_drive * DEV_PER_DRIVE, P_PRIMARY, 0); +#else /* patch */ +#endif } return(OK); } @@ -407,6 +471,7 @@ *===========================================================================*/ PRIVATE void w_init() { +#if 0 /* This routine is called at startup to initialize the drive parameters. */ int r, drive, drive_id, nr_drives; @@ -530,6 +595,8 @@ } wn->part[0].dv_size = mul64u(capacity, SECTOR_SIZE); } +#else /* patch */ +#endif } /*============================================================================* diff -ru _/src/drivers/lance/Makefile src/drivers/lance/Makefile --- _/src/drivers/lance/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/drivers/lance/Makefile 2010-12-11 00:00:00.000000000 +0900 @@ -2,7 +2,8 @@ DRIVER = lance # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys m = $i/minix @@ -10,9 +11,13 @@ d = .. # programs, flags, etc. -CC = exec cc -CFLAGS = -I$i $(CPROFILE) -LDFLAGS = -i +#CC = exec cc +CC = exec $(MINIX_GCC) +#CFLAGS = -I$i $(CPROFILE) +CFLAGS = -I$i $(CPROFILE) -I../../../yanakernel0prototype/yanakernel0a/sample/$(MINIX_CHIP)/common +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -lsys #-lutils -ltimers @@ -21,13 +26,15 @@ # build local binary all build: $(DRIVER) $(DRIVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 16k $(DRIVER) +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 16k $(DRIVER) + elf2aout -v -S 16k $@.elf $@ # install with other drivers install: /usr/sbin/$(DRIVER) /usr/sbin/$(DRIVER): $(DRIVER) - install -o root -cs $? $@ +# install -o root -cs $? $@ # clean up local files clean: @@ -37,4 +44,4 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/drivers/lance/lance.c src/drivers/lance/lance.c --- _/src/drivers/lance/lance.c 2006-07-10 21:43:38.000000000 +0900 +++ src/drivers/lance/lance.c 2010-12-11 00:00:00.000000000 +0900 @@ -64,6 +64,12 @@ /*#include "proc.h"*/ #include +#if 0 +#else /* patch */ +#undef TESTMIPS32 +#undef TESTMIPS64 +#include "device.h" +#endif /* new I/O functions in Minix 3 */ #define out_byte( x, y ) sys_outb( x, y ) @@ -71,20 +77,26 @@ static U8_t in_byte(U16_t port) { +#if 0 unsigned long value; int s; if ((s=sys_inb(port, &value)) != OK) printf( "lance: warning, sys_inb failed: %d\n", s ); return (U8_t) value; +#else /* patch */ +#endif } static U16_t in_word( U16_t port) { +#if 0 unsigned long value; int s; if ((s=sys_inw(port, &value)) != OK) printf( "lance: warning, sys_inw failed: %d\n", s ); return (U16_t) value; +#else /* patch */ +#endif } /* #define in_byte( x ) inb( x ) @@ -315,6 +327,13 @@ ether_card_t *ec; long v; int fkeys, sfkeys; +#if 0 +#else /* patch */ + int index; + vir_bytes off; + u16_t seg; + sys_segctl(&index, &seg, &off, DEVICE_ETHER_BUFFER, DEVICE_ETHER_COMMAND + 4 - DEVICE_ETHER_BUFFER); +#endif (progname=strrchr(argv[0],'/')) ? progname++ : (progname=argv[0]); env_setargs( argc, argv ); @@ -409,6 +428,7 @@ *===========================================================================*/ static void lance_dump() { +#if 0 ether_card_t *ec; int i, isr; unsigned short ioaddr; @@ -456,6 +476,8 @@ printf("irq = %d\tioadr = %d\n", ec->ec_irq, ec->ec_port); } +#else /* patch */ +#endif } /*===========================================================================* @@ -491,7 +513,10 @@ ether_card_t *ec; message reply_mess; +#if 0 pci_init(); +#else /* patch */ +#endif port = mp->DL_PORT; if (port < 0 || port >= EC_PORT_NR_MAX) @@ -508,6 +533,7 @@ { /* This is the default, try to (re)locate the device. */ /* only try to enable if memory is correct for DMA */ +#if 0 if ( CORRECT_DMA_MEM() ) { conf_hw(ec); @@ -516,6 +542,10 @@ { report( "LANCE", "DMA denied because address out of range", NO_NUM ); } +#else /* patch */ + ec->ec_irq = ETHER_IRQ; + ec->mode = EC_ENABLED; +#endif if (ec->mode == EC_DISABLED) { @@ -818,6 +848,7 @@ static void ec_reinit(ec) ether_card_t *ec; { +#if 0 int i; unsigned short ioaddr = ec->ec_port; @@ -865,6 +896,8 @@ out_word(ioaddr+LANCE_DATA, 0x142); /* start && enable interrupt */ return; +#else /* patch */ +#endif } /*===========================================================================* @@ -873,6 +906,7 @@ static void ec_check_ints(ec) ether_card_t *ec; { +#if 0 int must_restart=0; int check,status; int isr=0x0000; @@ -1023,6 +1057,11 @@ #endif ec_reset(ec); } +#else /* patch */ + if (*(volatile unsigned int *)DEVICE_ETHER_STATUS != 0) { + ec_recv(ec); + } +#endif } /*===========================================================================* @@ -1031,6 +1070,7 @@ static void ec_reset(ec) ether_card_t *ec; { +#if 0 /* Stop/start the chip, and clear all RX,TX-slots */ unsigned short ioaddr = ec->ec_port; int i; @@ -1058,6 +1098,8 @@ /* store a buffered message on the slot if exists */ ec_send(ec); ec->flags &= ~ECF_STOPPED; +#else /* patch */ +#endif } /*===========================================================================* @@ -1135,9 +1177,15 @@ packet_processed = FALSE; while (!packet_processed) { +#if 0 status = lp->rx_ring[rx_slot_nr].u.base >> 24; if ( (status & 0x80) == 0x00 ) +#else /* patch */ + *(volatile unsigned int *)DEVICE_ETHER_COMMAND = DEVICE_ETHER_COMMAND_RX; + if (*(volatile unsigned int *)DEVICE_ETHER_STATUS != 0) +#endif { +#if 0 status = lp->rx_ring[rx_slot_nr].u.base >> 24; /* ??? */ @@ -1160,17 +1208,32 @@ ec->eth_stat.ets_packetR++; length = lp->rx_ring[rx_slot_nr].msg_length; } +#else /* patch */ + length = *(volatile unsigned int *)DEVICE_ETHER_PACKETLENGTH; +#endif if (length > 0) { +#if 0 ec_nic2user(ec, (int)(lp->rbuf[rx_slot_nr]), &ec->read_iovec, 0, length); +#else /* patch */ + ec_nic2user(ec, DEVICE_ETHER_BUFFER, + &ec->read_iovec, 0, length); +#endif +#if 0 +#else /* patch */ + if (length < ETH_MIN_PACK_SIZE) { + length = ETH_MIN_PACK_SIZE; + } +#endif ec->read_s = length; ec->flags |= ECF_PACK_RECV; ec->flags &= ~ECF_READING; packet_processed = TRUE; } /* set up this slot again, and we move to the next slot */ +#if 0 lp->rx_ring[rx_slot_nr].buf_length = -ETH_FRAME_LEN; lp->rx_ring[rx_slot_nr].u.addr[3] |= 0x80; @@ -1178,6 +1241,8 @@ out_word(ioaddr+LANCE_DATA, 0x7940); rx_slot_nr = (++rx_slot_nr) & RX_RING_MOD_MASK; +#else /* patch */ +#endif } else break; @@ -1200,6 +1265,7 @@ ec = &ec_table[port]; ec->client= mp->DL_PROC; +#if 0 if (isstored[tx_slot_nr]==1) { /* all slots are used, so this message is buffered */ @@ -1208,6 +1274,8 @@ reply(ec, OK, FALSE); return; } +#else /* patch */ +#endif /* convert the message to write_iovec */ get_userdata_s(mp->DL_PROC, mp->DL_GRANT, 0, @@ -1223,9 +1291,15 @@ ec->write_s = calc_iovec_size(&ec->tmp_iovec); /* copy write_iovec to the slot on DMA address */ +#if 0 ec_user2nic(ec, &ec->write_iovec, 0, (int)(lp->tbuf[tx_slot_nr]), ec->write_s); +#else /* patch */ + ec_user2nic(ec, &ec->write_iovec, 0, + DEVICE_ETHER_BUFFER, ec->write_s); +#endif /* set-up for transmitting, and transmit it if needed. */ +#if 0 lp->tx_ring[tx_slot_nr].buf_length = -ec->write_s; lp->tx_ring[tx_slot_nr].misc = 0x0; lp->tx_ring[tx_slot_nr].u.base @@ -1244,6 +1318,10 @@ out_word(ioaddr+LANCE_ADDR, 0x0000); out_word(ioaddr+LANCE_DATA, 0x0048); } +#else /* patch */ + *(volatile unsigned int *)DEVICE_ETHER_PACKETLENGTH = ec->write_s; + *(volatile unsigned int *)DEVICE_ETHER_COMMAND = DEVICE_ETHER_COMMAND_TX; +#endif ec->flags |= ECF_PACK_SEND; @@ -1303,9 +1381,15 @@ if (bytes > count) bytes = count; +#if 0 if ( (r=sys_safecopyfrom(iovp->iod_proc_nr, iovp->iod_iovec[i].iov_grant, offset, nic_addr, bytes, D )) != OK ) +#else /* patch */ + if ( (r=sys_safecopyfrom(iovp->iod_proc_nr, + iovp->iod_iovec[i].iov_grant, offset, + nic_addr, bytes, PHYS_SEG )) != OK ) +#endif panic( __FILE__, "ec_user2nic: sys_safecopyfrom failed", r ); count -= bytes; @@ -1344,8 +1428,13 @@ bytes = iovp->iod_iovec[i].iov_size - offset; if (bytes > count) bytes = count; +#if 0 if ( (r=sys_safecopyto( iovp->iod_proc_nr, iovp->iod_iovec[i].iov_grant, offset, nic_addr, bytes, D )) != OK ) +#else /* patch */ + if ( (r=sys_safecopyto( iovp->iod_proc_nr, iovp->iod_iovec[i].iov_grant, + offset, nic_addr, bytes, PHYS_SEG )) != OK ) +#endif panic( __FILE__, "ec_nic2user: sys_safecopyto failed: ", r ); count -= bytes; @@ -1441,6 +1530,7 @@ static void do_stop(mp) message *mp; { +#if 0 int port; ether_card_t *ec; unsigned short ioaddr; @@ -1461,6 +1551,8 @@ out_word(ioaddr+LANCE_RESET, in_word(ioaddr+LANCE_RESET)); /* reset */ ec->flags = ECF_EMPTY; +#else /* patch */ +#endif } static void getAddressing(devind, ec) @@ -1504,6 +1596,7 @@ static int lance_probe(ec) ether_card_t *ec; { +#if 0 unsigned short pci_cmd, attached = 0; unsigned short ioaddr; int lance_version, chip_version; @@ -1647,6 +1740,8 @@ #endif return lance_version; +#else /* patch */ +#endif } /*===========================================================================* @@ -1671,6 +1766,7 @@ static void lance_init_card(ec) ether_card_t *ec; { +#if 0 int i; Address l; unsigned short ioaddr = ec->ec_port; @@ -1779,4 +1875,6 @@ out_word(ioaddr+LANCE_DATA, 0x142); /* start && enable interrupt */ return; +#else /* patch */ +#endif } diff -ru _/src/drivers/lance/lance.h src/drivers/lance/lance.h --- _/src/drivers/lance/lance.h 2006-07-10 21:43:38.000000000 +0900 +++ src/drivers/lance/lance.h 2010-12-11 00:00:00.000000000 +0900 @@ -22,7 +22,11 @@ /* supported max number of ether cards */ +#if 0 #define EC_PORT_NR_MAX 2 +#else /* patch */ +#define EC_PORT_NR_MAX 1 +#endif /* macros for 'mode' */ #define EC_DISABLED 0x0 diff -ru _/src/drivers/libdriver/Makefile src/drivers/libdriver/Makefile --- _/src/drivers/libdriver/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/drivers/libdriver/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -1,14 +1,16 @@ # Makefile for driver library # Directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys b = $i/ibm m = $i/minix # Programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CFLAGS = -I$i $(CPROFILE) LDFLAGS = -i LIBS = -lsysutil -lsys @@ -19,7 +21,8 @@ all build install: $(LIB) $(LIB): $(OBJECTS) - ar rc $(LIB) $(OBJECTS) +# ar rc $(LIB) $(OBJECTS) + $(MINIX_GAR) rc $(LIB) $(OBJECTS) # $(CC) -c $@ $(LDFLAGS) $(OBJ) $(LIBS) @@ -30,5 +33,5 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/drivers/log/Makefile src/drivers/log/Makefile --- _/src/drivers/log/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/drivers/log/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,7 +2,8 @@ DRIVER = log # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys m = $i/minix @@ -10,9 +11,12 @@ # programs, flags, etc. MAKE = exec make -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CFLAGS = -I$i $(CPROFILE) -LDFLAGS = -i -L../libdriver +#LDFLAGS = -i -L../libdriver +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a ../libdriver/libdriver.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -ldriver -lsys OBJ = log.o diag.o kputc.o @@ -20,12 +24,14 @@ # build local binary all build: $(DRIVER) $(DRIVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 16kb $(DRIVER) +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 16kb $(DRIVER) + elf2aout -v -S 16kb $@.elf $@ # install with other drivers install: $(DRIVER) - install -o root -cs $? /sbin/$(DRIVER) +# install -o root -cs $? /sbin/$(DRIVER) # clean up local files clean: @@ -36,5 +42,5 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/drivers/memory/Makefile src/drivers/memory/Makefile --- _/src/drivers/memory/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/drivers/memory/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,7 +2,8 @@ DRIVER = memory # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys m = $i/minix @@ -11,15 +12,19 @@ # programs, flags, etc. MAKE = exec make -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CFLAGS = -I$i -LDFLAGS = -i -L../libdriver +#LDFLAGS = -i -L../libdriver +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a ../libdriver/libdriver.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -ldriver -lsys # imgrd_s.s is the ACK assembler version of the ramdisk. For more portability, # use the C version imgrd.c. However, the C compiler takes too much memory # compiling imgrd.c. -IMGRD=imgrd_s.o +#IMGRD=imgrd_s.o +IMGRD=imgrd.o #IMGRD=imgrd.c OBJ = memory.o allocmem.o $(IMGRD) @@ -28,8 +33,10 @@ all build: $(DRIVER) $(DRIVER): ramdisk_image $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 8k $(DRIVER) +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $(OBJ) $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 8k $(DRIVER) + elf2aout -v -S 8k $@.elf $@ imgrd.o: ramdisk/image.c @@ -42,7 +49,7 @@ # install with other drivers install: /usr/sbin/$(DRIVER) /usr/sbin/$(DRIVER): $(DRIVER) - install -o root -cs $? $@ +# install -o root -cs $? $@ # clean up local files clean: @@ -54,5 +61,5 @@ cd ramdisk && make depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/drivers/memory/ramdisk/Makefile src/drivers/memory/ramdisk/Makefile --- _/src/drivers/memory/ramdisk/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/drivers/memory/ramdisk/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -22,86 +22,89 @@ bintoc: bintoc.c $(CC) -o $@ bintoc.c -image: proto.gen mtab rc $(PROGRAMS) $(EXTRA) - mkfs image proto.gen || { rm -f image; false; } +#image: proto.gen mtab rc $(PROGRAMS) $(EXTRA) +image: proto rc ../../bios_wini/bios_wini ../../../commands/simple/dev2name ../../../commands/simple/newroot ../../../commands/ash/sh ../../../servers/rs/service ../../../commands/simple/sysenv ../../../servers/mfs/mfs ../../../etc/drivers.conf ../../../etc/passwd +# mkfs image proto.gen || { rm -f image; false; } + dd if=/dev/zero of=image count=2048 + mkffs image proto || { rm -f image; false; } at_wini: ../../at_wini/at_wini - install -s ../../$@/$@ $@ +# install -s ../../$@/$@ $@ ../../at_wini/at_wini: cd ../../at_wini && make bios_wini: ../../bios_wini/bios_wini - install -s ../../$@/$@ $@ +# install -s ../../$@/$@ $@ ../../bios_wini/bios_wini: cd ../../bios_wini && make floppy: ../../floppy/floppy - install -s ../../$@/$@ $@ +# install -s ../../$@/$@ $@ ../../floppy/floppy: cd ../../floppy && make pci: ../../pci/pci - install -s ../../$@/$@ $@ +# install -s ../../$@/$@ $@ ../../pci/pci: cd ../../pci && make cdprobe: ../../../commands/simple/cdprobe - install -s ../../../commands/simple/$@ $@ +# install -s ../../../commands/simple/$@ $@ ../../../commands/simple/cdprobe: cd ../../../commands/simple && make cdprobe dev2name: ../../../commands/simple/dev2name - install -s ../../../commands/simple/$@ $@ +# install -s ../../../commands/simple/$@ $@ ../../../commands/simple/dev2name: cd ../../../commands/simple && make dev2name loadramdisk: ../../../commands/simple/loadramdisk - install -s ../../../commands/simple/$@ $@ +# install -s ../../../commands/simple/$@ $@ ../../../commands/simple/loadramdisk: cd ../../../commands/simple && make loadramdisk newroot: ../../../commands/simple/newroot - install -s ../../../commands/simple/$@ $@ +# install -s ../../../commands/simple/$@ $@ ../../../commands/simple/newroot: cd ../../../commands/simple && make newroot sysenv: ../../../commands/simple/sysenv - install -s ../../../commands/simple/$@ $@ +# install -s ../../../commands/simple/$@ $@ ../../../commands/simple/sysenv: cd ../../../commands/simple && make sysenv sh: ../../../commands/ash/sh - install -s ../../../commands/ash/$@ $@ +# install -s ../../../commands/ash/$@ $@ ../../../commands/ash/sh: cd ../../../commands/ash && make sh service: ../../../servers/rs/service - install -s ../../../servers/rs/$@ $@ +# install -s ../../../servers/rs/$@ $@ ../../../servers/rs/service: cd ../../../servers/rs && make service mfs: ../../../servers/mfs/mfs - install -s ../../../servers/mfs/$@ $@ +# install -s ../../../servers/mfs/$@ $@ ../../../servers/mfs/mfs: cd ../../../servers/mfs && make drivers.conf: ../../../etc/drivers.conf - install -s ../../../etc/$@ $@ +# install -s ../../../etc/$@ $@ passwd: ../../../etc/passwd - install -s ../../../etc/$@ $@ +# install -s ../../../etc/$@ $@ depend: mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend @@ -110,5 +113,5 @@ sh -e proto.sh >proto.gen # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/drivers/memory/ramdisk/proto src/drivers/memory/ramdisk/proto --- _/src/drivers/memory/ramdisk/proto 2007-02-24 03:22:46.000000000 +0900 +++ src/drivers/memory/ramdisk/proto 2010-11-11 00:00:00.000000000 +0900 @@ -1,29 +1,33 @@ boot -130 400 +256 512 d--755 0 0 bin d--755 0 0 - at_wini ---755 0 0 at_wini - bios_wini ---755 0 0 bios_wini - cdprobe ---755 0 0 cdprobe - dev2name ---755 0 0 dev2name - floppy ---755 0 0 floppy - loadramdisk ---755 0 0 loadramdisk - newroot ---755 0 0 newroot - pci ---755 0 0 pci - sh ---755 0 0 sh - service ---755 0 0 service - sysenv ---755 0 0 sysenv + bios_wini ---755 0 0 ../../bios_wini/bios_wini + dev2name ---755 0 0 ../../../commands/simple/dev2name + newroot ---755 0 0 ../../../commands/simple/newroot + sh ---755 0 0 ../../../commands/ash/sh + service ---755 0 0 ../../../servers/rs/service + sysenv ---755 0 0 ../../../commands/simple/sysenv $ sbin d--755 0 0 - mfs ---755 0 0 mfs + mfs ---755 0 0 ../../../servers/mfs/mfs $ dev d--755 0 0 -@DEV@ + c0d0 b--777 0 0 3 0 + c0d1 b--777 0 0 3 1 + c0d2 b--777 0 0 3 2 + c0d3 b--777 0 0 3 3 + c0d4 b--777 0 0 3 4 + c0d5 b--777 0 0 3 5 + c0d6 b--777 0 0 3 6 + c0d7 b--777 0 0 3 7 + console c--777 0 0 4 0 + log c--777 0 0 4 15 + null c--777 0 0 1 3 $ etc d--755 0 0 - drivers.conf ---644 0 0 drivers.conf - mtab ---644 0 0 mtab - passwd ---644 0 0 passwd + drivers.conf ---644 0 0 ../../../etc/drivers.conf + passwd ---644 0 0 ../../../etc/passwd rc ---755 0 0 rc $ $ diff -ru _/src/drivers/memory/ramdisk/rc src/drivers/memory/ramdisk/rc --- _/src/drivers/memory/ramdisk/rc 2007-02-08 23:23:04.000000000 +0900 +++ src/drivers/memory/ramdisk/rc 2010-11-11 00:00:00.000000000 +0900 @@ -1,40 +1,40 @@ #!/bin/sh set -e -/bin/service up /bin/pci -config /etc/drivers.conf -/bin/service -c up /bin/floppy -config /etc/drivers.conf -dev /dev/fd0 -if [ X`/bin/sysenv bios_wini` = Xyes ] -then +#/bin/service up /bin/pci -config /etc/drivers.conf +#/bin/service -c up /bin/floppy -config /etc/drivers.conf -dev /dev/fd0 +#if [ X`/bin/sysenv bios_wini` = Xyes ] +#then echo Using bios_wini. /bin/service -c up /bin/bios_wini -dev /dev/c0d0 -else - /bin/service -c up /bin/at_wini -dev /dev/c0d0 -config /etc/drivers.conf -label at_wini_0 - /bin/service -c up /bin/at_wini -dev /dev/c1d0 -config /etc/drivers.conf -label at_wini_1 -args ata_instance=1 - #/bin/service -c up /bin/at_wini -dev /dev/c0d0 -script /etc/rs.single -config /etc/drivers.conf -fi +#else +# /bin/service -c up /bin/at_wini -dev /dev/c0d0 -config /etc/drivers.conf -label at_wini_0 +# /bin/service -c up /bin/at_wini -dev /dev/c1d0 -config /etc/drivers.conf -label at_wini_1 -args ata_instance=1 +# #/bin/service -c up /bin/at_wini -dev /dev/c0d0 -script /etc/rs.single -config /etc/drivers.conf +#fi rootdev=`sysenv rootdev` || echo 'No rootdev?' rootdevname=`/bin/dev2name "$rootdev"` || { echo 'No device name for root device'; exit 1; } -if sysenv cdproberoot >/dev/null -then - echo - echo 'Looking for boot CD. This may take a minute.' - echo 'Please ignore any error messages.' - echo - cddev=`cdprobe` || { echo 'No CD found'; exit 1; } - export cddev - echo "Loading ramdisk from ${cddev}p1" - loadramdisk "$cddev"p1 -elif [ "$rootdevname" = "/dev/ram" ] -then - ramimagedev=`sysenv ramimagedev` || - { echo 'ramimagedev not found'; exit 1; } - ramimagename=`/bin/dev2name "$ramimagedev"` || - { echo 'No device name for ramimagedev'; exit 1; } - echo "Loading ramdisk from $ramimagename" - loadramdisk "$ramimagename" -fi +#if sysenv cdproberoot >/dev/null +#then +# echo +# echo 'Looking for boot CD. This may take a minute.' +# echo 'Please ignore any error messages.' +# echo +# cddev=`cdprobe` || { echo 'No CD found'; exit 1; } +# export cddev +# echo "Loading ramdisk from ${cddev}p1" +# loadramdisk "$cddev"p1 +#elif [ "$rootdevname" = "/dev/ram" ] +#then +# ramimagedev=`sysenv ramimagedev` || +# { echo 'ramimagedev not found'; exit 1; } +# ramimagename=`/bin/dev2name "$ramimagedev"` || +# { echo 'No device name for ramimagedev'; exit 1; } +# echo "Loading ramdisk from $ramimagename" +# loadramdisk "$ramimagename" +#fi echo "Root device name is $rootdevname" /bin/newroot "$rootdevname" exec /bin/sh /etc/rc "$@" diff -ru _/src/drivers/tty/Makefile src/drivers/tty/Makefile --- _/src/drivers/tty/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/drivers/tty/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -1,10 +1,12 @@ # Makefile for terminal driver (TTY) DRIVER = tty -include /etc/make.conf +#include /etc/make.conf +include $(MINIX_SOURCE)/etc/make.conf # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys m = $i/minix @@ -13,36 +15,43 @@ # programs, flags, etc. MAKE = exec make -CC = exec cc -CPPFLAGS = -I$i -I../../kernel/arch/$(ARCH)/include +#CC = exec cc +CC = exec $(MINIX_GCC) +#CPPFLAGS = -I$i -I../../kernel/arch/$(ARCH)/include +CPPFLAGS = -I$i -I../../kernel/arch/$(ARCH)/include -I../../../yanakernel0prototype/yanakernel0a/sample/$(MINIX_CHIP)/common CFLAGS = $(CPPFLAGS) -LDFLAGS = -i +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libtimers.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -lsys -ltimers -OBJ = tty.o console.o vidcopy.o keyboard.o pty.o rs232.o +#OBJ = tty.o console.o vidcopy.o keyboard.o pty.o rs232.o +OBJ = tty.o console.o keyboard.o pty.o # build local binary all build: $(DRIVER) $(DRIVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 8k $(DRIVER) +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 8k $(DRIVER) + elf2aout -v -S 8k $@.elf $@ # install with other drivers install: - cd keymaps && $(MAKE) -$(MAKEFLAGS) install +# cd keymaps && $(MAKE) -$(MAKEFLAGS) install #/sbin/$(DRIVER): $(DRIVER) # install -o root -cs $? $@ # clean up local files clean: - cd keymaps && $(MAKE) -$(MAKEFLAGS) $@ +# cd keymaps && $(MAKE) -$(MAKEFLAGS) $@ rm -f $(DRIVER) *.o *.bak depend: mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/drivers/tty/console.c src/drivers/tty/console.c --- _/src/drivers/tty/console.c 2007-02-08 01:22:20.000000000 +0900 +++ src/drivers/tty/console.c 2010-11-11 00:00:00.000000000 +0900 @@ -27,6 +27,12 @@ #include "../../kernel/const.h" #include "../../kernel/config.h" #include "../../kernel/type.h" +#if 0 +#else /* patch */ +#undef TESTMIPS32 +#undef TESTMIPS64 +#include "device.h" +#endif /* Definitions used by the console driver. */ #define MONO_BASE 0xB0000L /* base of mono video memory */ @@ -243,6 +249,7 @@ register console_t *cons; /* pointer to console struct */ int c; /* character to be output */ { +#if 0 /* Output a character on the console. Check for escape sequences first. */ if (cons->c_esc_state > 0) { parse_escape(cons, c); @@ -320,6 +327,9 @@ cons->c_column++; /* next column */ return; } +#else /* patch */ + device_cons_putchar(c); +#endif } /*===========================================================================* @@ -329,6 +339,7 @@ register console_t *cons; /* pointer to console struct */ int dir; /* SCROLL_UP or SCROLL_DOWN */ { +#if 0 unsigned new_line, new_org, chars; flush(cons); @@ -374,6 +385,8 @@ /* Set the new video origin. */ if (cons == curcons) set_6845(VID_ORG, cons->c_org); flush(cons); +#else /* patch */ +#endif } /*===========================================================================* @@ -382,6 +395,7 @@ PRIVATE void flush(cons) register console_t *cons; /* pointer to console struct */ { +#if 0 /* Send characters buffered in 'ramqueue' to screen memory, check the new * cursor position, compute the new hardware cursor position and set it. */ @@ -408,6 +422,8 @@ if (cons == curcons) set_6845(CURSOR, cur); cons->c_cur = cur; } +#else /* patch */ +#endif } /*===========================================================================* @@ -476,6 +492,7 @@ register console_t *cons; /* pointer to console struct */ char c; /* next character in escape sequence */ { +#if 0 int value, n; unsigned src, dst, count; int *parmp; @@ -709,6 +726,8 @@ } } cons->c_esc_state = 0; +#else /* patch */ +#endif } /*===========================================================================* @@ -718,6 +737,7 @@ int reg; /* which register pair to set */ unsigned val; /* 16-bit value to set it to */ { +#if 0 /* Set a register pair inside the 6845. * Registers 12-13 tell the 6845 where in video ram to start * Registers 14-15 tell the 6845 where to put the cursor @@ -728,6 +748,8 @@ pv_set(char_out[2], vid_port + INDEX, reg + 1); /* again */ pv_set(char_out[3], vid_port + DATA, val&BYTE); /* low byte */ sys_voutb(char_out, 4); /* do actual output */ +#else /* patch */ +#endif } /*===========================================================================* @@ -737,6 +759,7 @@ int reg; /* which register pair to set */ unsigned *val; /* 16-bit value to set it to */ { +#if 0 char v1, v2; unsigned long v; /* Get a register pair inside the 6845. */ @@ -747,6 +770,8 @@ sys_inb(vid_port + DATA, &v); v2 = v; *val = (v1 << 8) | v2; +#else /* patch */ +#endif } /*===========================================================================* @@ -754,6 +779,7 @@ *===========================================================================*/ PRIVATE void beep() { +#if 0 /* Making a beeping sound on the speaker (output for CRTL-G). * This routine works by turning on the bits 0 and 1 in port B of the 8255 * chip that drive the speaker. @@ -785,6 +811,8 @@ if ((s=sys_setalarm(tty_next_timeout, 1)) != OK) panic("TTY","Console couldn't set alarm.", s); } +#else /* patch */ +#endif } @@ -865,6 +893,7 @@ unsigned freq; clock_t dur; { +#if 0 /* Making a beeping sound on the speaker. * This routine works by turning on the bits 0 and 1 in port B of the 8255 * chip that drive the speaker. @@ -900,6 +929,8 @@ if ((s=sys_setalarm(tty_next_timeout, 1)) != OK) panic("TTY","Console couldn't set alarm.", s); } +#else /* patch */ +#endif } /*===========================================================================* @@ -908,11 +939,14 @@ PRIVATE void stop_beep(tmrp) timer_t *tmrp; { +#if 0 /* Turn off the beeper by turning off bits 0 and 1 in PORT_B. */ unsigned long port_b_val; if (sys_inb(PORT_B, &port_b_val)==OK && sys_outb(PORT_B, (port_b_val & ~3))==OK) beeping = FALSE; +#else /* patch */ +#endif } /*===========================================================================* @@ -947,6 +981,7 @@ if (! vdu_initialized++) { /* How about error checking? What to do on failure??? */ +#if 0 s=sys_readbios(VDU_SCREEN_COLS_ADDR, &bios_columns, VDU_SCREEN_COLS_SIZE); s=sys_readbios(VDU_CRT_BASE_ADDR, &bios_crtbase, @@ -955,6 +990,8 @@ VDU_SCREEN_ROWS_SIZE); s=sys_readbios(VDU_FONTLINES_ADDR, &bios_fontlines, VDU_FONTLINES_SIZE); +#else /* patch */ +#endif vid_port = bios_crtbase; scr_width = bios_columns; @@ -971,7 +1008,11 @@ if (machine.vdu_ega) vid_size = EGA_SIZE; wrap = ! machine.vdu_ega; +#if 0 s = sys_segctl(&vid_index, &vid_seg, &vid_off, vid_base, vid_size); +#else /* patch */ + s = sys_segctl(&vid_index, &vid_seg, &vid_off, DEVICE_CONS_PUTGETCHAR, 1); +#endif vid_size >>= 1; /* word count */ vid_mask = vid_size - 1; @@ -980,7 +1021,10 @@ scr_size = scr_lines * scr_width; /* There can be as many consoles as video memory allows. */ +#if 0 nr_cons = vid_size / scr_size; +#else /* patch */ +#endif if (nr_cons > NR_CONS) nr_cons = NR_CONS; if (nr_cons > 1) wrap = 0; page_size = vid_size / nr_cons; @@ -994,7 +1038,10 @@ if (line != 0) { /* Clear the non-console vtys. */ blank_color = BLANK_COLOR; +#if 0 mem_vid_copy(BLANK_MEM, cons->c_start, scr_size); +#else /* patch */ +#endif } else { int i, n; /* Set the cursor of the console vty at the bottom. c_cur @@ -1204,6 +1251,7 @@ *===========================================================================*/ PRIVATE void cons_org0() { +#if 0 /* Scroll video memory back to put the origin at 0. */ int cons_line; console_t *cons; @@ -1221,6 +1269,8 @@ flush(cons); } select_console(ccurrent); +#else /* patch */ +#endif } /*===========================================================================* @@ -1314,6 +1364,7 @@ PRIVATE int ga_program(seq) struct sequence *seq; { +#if 0 pvb_pair_t char_out[14]; int i; for (i=0; i<7; i++) { @@ -1322,6 +1373,8 @@ seq++; } return sys_voutb(char_out, 14); +#else /* patch */ +#endif } /*===========================================================================* @@ -1346,6 +1399,7 @@ PRIVATE void ser_putc(char c) { +#if 0 unsigned long b; int i; int lsr, thr; @@ -1359,4 +1413,6 @@ break; } sys_outb(thr, c); +#else /* patch */ +#endif } diff -ru _/src/drivers/tty/keyboard.c src/drivers/tty/keyboard.c --- _/src/drivers/tty/keyboard.c 2007-02-08 01:22:20.000000000 +0900 +++ src/drivers/tty/keyboard.c 2010-11-11 00:00:00.000000000 +0900 @@ -24,6 +24,12 @@ #include "../../kernel/config.h" #include "../../kernel/type.h" #include "../../kernel/proc.h" +#if 0 +#else /* patch */ +#undef TESTMIPS32 +#undef TESTMIPS64 +#include "device.h" +#endif int irq_hook_id = -1; int aux_irq_hook_id = -1; @@ -497,8 +503,14 @@ static timer_t timer; /* timer must be static! */ /* Fetch the character from the keyboard hardware and acknowledge it. */ +#if 0 if (!scan_keyboard(&scode, &isaux)) return; +#else /* patch */ + isaux = 0; + scode = device_cons_getchar(); + sys_irqenable(&irq_hook_id); +#endif if (isaux) kbdp= &kbdaux; @@ -566,10 +578,17 @@ icount--; /* Function keys are being used for debug dumps. */ +#if 0 if (func_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. */ @@ -617,6 +636,7 @@ *===========================================================================*/ PRIVATE void kbd_send() { +#if 0 unsigned long sb; int r; clock_t now; @@ -672,6 +692,8 @@ } kbd_watchdog_set= 1; } +#else /* patch */ +#endif } /*===========================================================================* @@ -759,6 +781,7 @@ *===========================================================================*/ PRIVATE void set_leds() { +#if 0 /* Set the LEDs on the caps, num, and scroll lock keys */ int s; if (! machine.pc_at) return; /* PC/XT doesn't have LEDs */ @@ -774,6 +797,8 @@ printf("Warning, sys_outb couldn't give LED values: %d\n", s); /* give keyboard LED values */ kb_ack(); /* wait for ack response */ +#else /* patch */ +#endif } /*===========================================================================* @@ -782,9 +807,12 @@ PRIVATE void kbc_cmd0(cmd) int cmd; { +#if 0 kb_wait(); if(sys_outb(KB_COMMAND, cmd) != OK) printf("kbc_cmd0: sys_outb failed\n"); +#else /* patch */ +#endif } /*===========================================================================* @@ -794,12 +822,15 @@ int cmd; int data; { +#if 0 kb_wait(); if(sys_outb(KB_COMMAND, cmd) != OK) printf("kbc_cmd1: 1 sys_outb failed\n"); kb_wait(); if(sys_outb(KEYBD, data) != OK) printf("kbc_cmd1: 2 sys_outb failed\n"); +#else /* patch */ +#endif } @@ -808,6 +839,7 @@ *===========================================================================*/ PRIVATE int kbc_read() { +#if 0 int i; unsigned long byte, st; #if 0 @@ -854,6 +886,8 @@ while (micro_elapsed(&ms) < 1000000); #endif panic("TTY", "kbc_read failed to complete", NO_NUM); +#else /* patch */ +#endif } @@ -863,6 +897,7 @@ *===========================================================================*/ PRIVATE int kb_wait() { +#if 0 /* Wait until the controller is ready; return zero if this times out. */ int retries; @@ -887,6 +922,8 @@ break; /* wait until ready */ } while (--retries != 0); /* continue unless timeout */ return(retries); /* zero on timeout, positive if ready */ +#else /* patch */ +#endif } /*===========================================================================* @@ -894,6 +931,7 @@ *===========================================================================*/ PRIVATE int kb_ack() { +#if 0 /* Wait until kbd acknowledges last command; return zero if this times out. */ int retries, s; @@ -910,6 +948,8 @@ } while(--retries != 0); /* continue unless timeout */ return(retries); /* nonzero if ack received */ +#else /* patch */ +#endif } /*===========================================================================* @@ -930,6 +970,13 @@ { int i; u8_t ccb; +#if 0 +#else /* patch */ + int index; + vir_bytes off; + u16_t seg; + sys_segctl(&index, &seg, &off, DEVICE_CONS_PUTGETCHAR, 1); +#endif set_leds(); /* turn off numlock led */ scan_keyboard(NULL, NULL); /* discard leftover keystroke */ @@ -947,13 +994,18 @@ /* Set interrupt handler and enable keyboard IRQ. */ irq_hook_id = KEYBOARD_IRQ; /* id to be returned on interrupt */ +#if 0 if ((i=sys_irqsetpolicy(KEYBOARD_IRQ, IRQ_REENABLE, &irq_hook_id)) != OK) +#else /* patch */ + if ((i=sys_irqsetpolicy(KEYBOARD_IRQ, 0, &irq_hook_id)) != OK) +#endif panic("TTY", "Couldn't set keyboard IRQ policy", i); if ((i=sys_irqenable(&irq_hook_id)) != OK) panic("TTY", "Couldn't enable keyboard IRQs", i); kbd_irq_set |= (1 << KEYBOARD_IRQ); /* Set AUX interrupt handler and enable AUX IRQ. */ +#if 0 aux_irq_hook_id = KBD_AUX_IRQ; /* id to be returned on interrupt */ if ((i=sys_irqsetpolicy(KBD_AUX_IRQ, IRQ_REENABLE, &aux_irq_hook_id)) != OK) @@ -961,6 +1013,8 @@ if ((i=sys_irqenable(&aux_irq_hook_id)) != OK) panic("TTY", "Couldn't enable AUX IRQs", i); kbd_irq_set |= (1 << KBD_AUX_IRQ); +#else /* patch */ +#endif /* Disable the keyboard and aux */ kbc_cmd0(KBC_DI_KBD); @@ -1195,6 +1249,7 @@ unsigned char *bp; int *isauxp; { +#if 0 #if 0 /* Is this old XT code? It doesn't match the PS/2 hardware */ /* Fetch the character from the keyboard hardware and acknowledge it. */ pvb_pair_t byte_in[2], byte_out[2]; @@ -1248,6 +1303,8 @@ } return 1; #endif +#else /* patch */ +#endif } static void micro_delay(unsigned long usecs) diff -ru _/src/include/ibm/interrupt.h src/include/ibm/interrupt.h --- _/src/include/ibm/interrupt.h 2006-10-31 00:53:38.000000000 +0900 +++ src/include/ibm/interrupt.h 2010-11-11 00:00:00.000000000 +0900 @@ -37,8 +37,16 @@ /* Hardware interrupt numbers. */ #define NR_IRQ_VECTORS 16 +#if 0 #define CLOCK_IRQ 0 +#else /* patch */ +#define CLOCK_IRQ 4 +#endif +#if 0 #define KEYBOARD_IRQ 1 +#else /* patch */ +#define KEYBOARD_IRQ 2 +#endif #define CASCADE_IRQ 2 /* cascade enable for 2nd AT controller */ #define ETHER_IRQ 3 /* default ethernet interrupt vector */ #define SECONDARY_IRQ 3 /* RS232 interrupt vector for port 2 */ diff -ru _/src/include/minix/config.h src/include/minix/config.h --- _/src/include/minix/config.h 2007-05-30 22:40:54.000000000 +0900 +++ src/include/minix/config.h 2010-11-11 00:00:00.000000000 +0900 @@ -96,7 +96,11 @@ * system can handle. */ #define NR_CONS 4 /* # system consoles (1 to 8) */ +#if 0 #define NR_RS_LINES 4 /* # rs232 terminals (0 to 4) */ +#else /* patch */ +#define NR_RS_LINES 0 /* # rs232 terminals (0 to 4) */ +#endif #define NR_PTYS 32 /* # pseudo terminals (0 to 64) */ /* This feature enable the counting of system calls in PM and FS */ diff -ru _/src/include/minix/ipc.h src/include/minix/ipc.h --- _/src/include/minix/ipc.h 2006-10-25 22:40:36.000000000 +0900 +++ src/include/minix/ipc.h 2010-11-11 00:00:00.000000000 +0900 @@ -108,11 +108,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 _/src/include/minix/u64.h src/include/minix/u64.h --- _/src/include/minix/u64.h 2005-04-21 23:53:54.000000000 +0900 +++ src/include/minix/u64.h 2010-11-11 00:00:00.000000000 +0900 @@ -9,6 +9,7 @@ #include #endif +#if 0 u64_t add64(u64_t i, u64_t j); u64_t add64u(u64_t i, unsigned j); u64_t add64ul(u64_t i, unsigned long j); @@ -29,5 +30,92 @@ unsigned long ex64lo(u64_t i); unsigned long ex64hi(u64_t i); u64_t make64(unsigned long lo, unsigned long hi); +#else /* patch */ +#include +__inline__ static u64_t add64(u64_t i, u64_t j) { + return i + j; +} +__inline__ static u64_t add64u(u64_t i, unsigned j) { + return i + j; +} +__inline__ static u64_t add64ul(u64_t i, unsigned long j) { + return i + j; +} +__inline__ static u64_t sub64(u64_t i, u64_t j) { + return i - j; +} +__inline__ static u64_t sub64u(u64_t i, unsigned j) { + return i - j; +} +__inline__ static u64_t sub64ul(u64_t i, unsigned long j) { + return i - j; +} +__inline__ static unsigned diff64(u64_t i, u64_t j) { + return i - j; +} +__inline__ static u64_t cvu64(unsigned i) { + return i; +} +__inline__ static u64_t cvul64(unsigned long i) { + return i; +} +__inline__ static unsigned cv64u(u64_t i) { + if (i >= UINT_MAX) { + return UINT_MAX; + } + return i; +} +__inline__ static unsigned long cv64ul(u64_t i) { + if (i >= ULONG_MAX) { + return ULONG_MAX; + } + return i; +} +__inline__ static unsigned long div64u(u64_t i, unsigned j) { + return i / j; +} +__inline__ static unsigned rem64u(u64_t i, unsigned j) { + return i % j; +} +__inline__ static u64_t mul64u(unsigned long i, unsigned j) { + return (u64_t)i * j; +} +__inline__ static int cmp64(u64_t i, u64_t j) { + if (i < j) { + return -1; + } else if (i == j) { + return 0; + } else { + return 1; + } +} +__inline__ static int cmp64u(u64_t i, unsigned j) { + if (i < j) { + return -1; + } else if (i == j) { + return 0; + } else { + return 1; + } +} +__inline__ static int cmp64ul(u64_t i, unsigned long j) { + if (i < j) { + return -1; + } else if (i == j) { + return 0; + } else { + return 1; + } +} +__inline__ static unsigned long ex64lo(u64_t i) { + return i; +} +__inline__ static unsigned long ex64hi(u64_t i) { + return i >> 32; +} +__inline__ static u64_t make64(unsigned long lo, unsigned long hi) { + return (u64_t)hi << 32 | lo; +} +#endif #endif /* _MINIX__U64_H */ diff -ru _/src/include/setjmp.h src/include/setjmp.h --- _/src/include/setjmp.h 2006-12-09 01:23:18.000000000 +0900 +++ src/include/setjmp.h 2010-11-11 00:00:00.000000000 +0900 @@ -65,7 +65,36 @@ #else /* GCC */ int __flags; /* XXX - long might give better alignment */ long __mask; /* must have size >= sizeof(sigset_t) */ +#if 0 void *__regs[16]; /* actual use is architecture dependent */ +#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 #endif } jmp_buf[1]; diff -ru _/src/include/stdio.h src/include/stdio.h --- _/src/include/stdio.h 2006-07-06 19:02:26.000000000 +0900 +++ src/include/stdio.h 2010-11-11 00:00:00.000000000 +0900 @@ -60,7 +60,11 @@ #define TMP_MAX 999 #define L_tmpnam (sizeof("/tmp/") + FILENAME_MAX) +#if 0 #define __STDIO_VA_LIST__ void * +#else /* patch */ +#include +#endif typedef long int fpos_t; @@ -87,17 +91,30 @@ _PROTOTYPE( int fprintf, (FILE *_stream, const char *_format, ...) ); _PROTOTYPE( int printf, (const char *_format, ...) ); _PROTOTYPE( int sprintf, (char *_s, const char *_format, ...) ); +#if 0 _PROTOTYPE( int vfprintf, (FILE *_stream, const char *_format, char *_arg) ); _PROTOTYPE( int vprintf, (const char *_format, char *_arg) ); _PROTOTYPE( int vsprintf, (char *_s, const char *_format, char *_arg) ); +#else /* patch */ +_PROTOTYPE( int vfprintf, + (FILE *_stream, const char *_format, va_list _arg) ); +_PROTOTYPE( int vprintf, (const char *_format, va_list _arg) ); +_PROTOTYPE( int vsprintf, (char *_s, const char *_format, va_list _arg) ); +#endif _PROTOTYPE( int fscanf, (FILE *_stream, const char *_format, ...) ); _PROTOTYPE( int scanf, (const char *_format, ...) ); _PROTOTYPE( int sscanf, (const char *_s, const char *_format, ...) ); #define vfscanf _doscan +#if 0 _PROTOTYPE( int vfscanf, (FILE *_stream, const char *_format, char *_arg)); _PROTOTYPE( int vscanf, (const char *_format, char *_arg) ); _PROTOTYPE( int vsscanf, (const char *_s, const char *_format, char *_arg)); +#else /* patch */ +_PROTOTYPE( int vfscanf, (FILE *_stream, const char *_format, va_list _arg)); +_PROTOTYPE( int vscanf, (const char *_format, va_list _arg) ); +_PROTOTYPE( int vsscanf, (const char *_s, const char *_format, va_list _arg)); +#endif _PROTOTYPE( int fgetc, (FILE *_stream) ); _PROTOTYPE( char *fgets, (char *_s, int _n, FILE *_stream) ); _PROTOTYPE( int fputc, (int _c, FILE *_stream) ); @@ -149,8 +166,13 @@ _PROTOTYPE(FILE *popen, (const char *_command, const char *_type)); _PROTOTYPE(int pclose, (FILE *_stream)); _PROTOTYPE(int snprintf, (char *_s, size_t _n, const char *_format, ...)); +#if 0 _PROTOTYPE(int vsnprintf, (char *_s, size_t _n, const char *_format, char *_arg) ); +#else /* patch */ +_PROTOTYPE(int vsnprintf, (char *_s, size_t _n, const char *_format, + va_list _arg) ); +#endif #endif #endif /* _STDIO_H */ diff -ru _/src/include/sys/sigcontext.h src/include/sys/sigcontext.h --- _/src/include/sys/sigcontext.h 2006-12-09 01:23:18.000000000 +0900 +++ src/include/sys/sigcontext.h 2010-11-11 00:00:00.000000000 +0900 @@ -24,6 +24,7 @@ */ #if (_MINIX_CHIP == _CHIP_INTEL) struct sigregs { +#if 0 #if _WORD_SIZE == 4 short sr_gs; short sr_fs; @@ -45,6 +46,63 @@ int sr_psw; int sr_sp; int sr_ss; +#else /* patch */ +#if defined(__arm__) + unsigned int retreg; + unsigned int r1; + unsigned int r2; + unsigned int r3; + 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 r12; + unsigned int sp; + unsigned int lr; + unsigned int pc; + unsigned int psw; +#elif defined(__mips__) + unsigned int pc; + unsigned int gpr1; + unsigned int retreg; + unsigned int gpr3; + unsigned int gpr4; + unsigned int gpr5; + unsigned int gpr6; + unsigned int gpr7; + unsigned int gpr8; + unsigned int gpr9; + unsigned int gpr10; + unsigned int gpr11; + unsigned int gpr12; + unsigned int gpr13; + unsigned int gpr14; + unsigned int gpr15; + 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 gpr24; + unsigned int gpr25; + unsigned int hi; + unsigned int lo; + unsigned int gpr28; + unsigned int sp; + unsigned int fp; + unsigned int lr; + unsigned int psw; +#else +#error sigregs +#endif +#endif }; struct sigframe { /* stack frame created for signalled process */ diff -ru _/src/include/sys/types.h src/include/sys/types.h --- _/src/include/sys/types.h 2006-11-27 23:21:44.000000000 +0900 +++ src/include/sys/types.h 2010-11-11 00:00:00.000000000 +0900 @@ -69,7 +69,11 @@ typedef short i16_t; /* 16 bit signed type */ typedef long i32_t; /* 32 bit signed type */ +#if 0 typedef struct { u32_t _[2]; } u64_t; +#else /* patch */ +typedef unsigned long long u64_t; +#endif /* The following types are needed because MINIX uses K&R style function * definitions (for maximum portability). When a short, such as dev_t, is diff -ru _/src/kernel/Makefile src/kernel/Makefile --- _/src/kernel/Makefile 2007-04-13 01:45:00.000000000 +0900 +++ src/kernel/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -1,28 +1,36 @@ # Makefile for kernel -include /etc/make.conf +#include /etc/make.conf +include $(MINIX_SOURCE)/etc/make.conf # Directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include l = $u/lib s = system a = arch/$(ARCH) # Programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CPP = $l/cpp LD = $(CC) -.o -CPPFLAGS=-I$i -I$a/include +#CPPFLAGS=-I$i -I$a/include +CPPFLAGS=-I$i -I$a/include -I. -I../../yanakernel0prototype/yanakernel0a/sample/$(MINIX_CHIP)/common -I../../yanakernel0prototype/yanakernel0a/kernel/$(MINIX_CHIP) -DMINIX_PROCESS=$(MINIX_PROCESS) CFLAGS=$(CPROFILE) $(CPPFLAGS) $(EXTRA_OPTS) -LDFLAGS=-i +#LDFLAGS=-i +LDFLAGS = -Wl,-Map,kernel.map -Wl,--cref -Wl,-e,MINIX -Wl,-Ttext,$(MINIX_KERNEL) -Wl,--defsym=__text_start=$(MINIX_KERNEL) +LDLIBS = $(SYSTEM) $(MINIX_SOURCE)/lib/obj-gnu/libtimers.a $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc # first-stage, arch-dependent startup code -HEAD = head.o +#HEAD = head.o +HEAD = ../$(MINIX_CHIP)/minix.o FULLHEAD = $a/$(HEAD) OBJS = start.o table.o main.o proc.o \ - system.o clock.o utility.o debug.o profile.o interrupt.o + system.o clock.o utility.o debug.o profile.o interrupt.o \ + ../$(MINIX_CHIP)/glue.o SYSTEM = system.a ARCHLIB = $a/$(ARCH).a LIBS = -ltimers -lsysutil @@ -31,19 +39,21 @@ all: build kernel build install: $(HEAD) $(OBJS) cd system && $(MAKE) $@ - cd $a && $(MAKE) $@ - $(LD) $(CFLAGS) $(LDFLAGS) -o kernel $(FULLHEAD) $(OBJS) \ - $(SYSTEM) $(ARCHLIB) $(LIBS) - install -S 0 kernel +# cd $a && $(MAKE) $@ +# $(LD) $(CFLAGS) $(LDFLAGS) -o kernel $(FULLHEAD) $(OBJS) \ +# $(SYSTEM) $(ARCHLIB) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o kernel.elf +# install -S 0 kernel + elf2aout -v -S 0 kernel.elf kernel clean: cd system && $(MAKE) -$(MAKEFLAGS) $@ - cd $a && $(MAKE) -$(MAKEFLAGS) $@ +# cd $a && $(MAKE) -$(MAKEFLAGS) $@ rm -f *.a *.o *~ *.bak kernel depend: cd system && $(MAKE) -$(MAKEFLAGS) $@ - cd $a && $(MAKE) $@ +# cd $a && $(MAKE) $@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # How to build it @@ -51,7 +61,7 @@ $(CC) $(CFLAGS) -c -o $@ $< $(HEAD): - cd $a && make HEAD=$(HEAD) $(HEAD) +# cd $a && make HEAD=$(HEAD) $(HEAD) # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/kernel/arch/i386/include/archconst.h src/kernel/arch/i386/include/archconst.h --- _/src/kernel/arch/i386/include/archconst.h 2006-12-23 00:22:28.000000000 +0900 +++ src/kernel/arch/i386/include/archconst.h 2010-11-11 00:00:00.000000000 +0900 @@ -127,8 +127,28 @@ #define LIMIT_HIGH 0x0F /* mask for high bits of limit */ /* Program stack words and masks. */ +#if 0 #define INIT_PSW 0x0200 /* initial psw */ +#else /* patch */ +#if defined(__arm__) +#define INIT_PSW 0x50 /* I = 0, F = 1, M = 0x10 */ +#elif defined(__mips__) +#define INIT_PSW 0x11 /* KSU = 2, IE = 1 */ +#else +#error INIT_USER_PSW +#endif +#endif +#if 0 #define INIT_TASK_PSW 0x1200 /* initial psw for tasks (with IOPL 1) */ +#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 #define TRACEBIT 0x0100 /* OR this with psw in proc[] for tracing */ #define SETPSW(rp, new) /* permits only certain bits to be set */ \ ((rp)->p_reg.psw = (rp)->p_reg.psw & ~0xCD5 | (new) & 0xCD5) @@ -141,6 +161,10 @@ */ #define NR_MEMS 8 +#if 0 #define vir2phys(vir) (kinfo.data_base + (vir_bytes) (vir)) +#else /* patch */ +#define vir2phys(vir) ((vir_bytes) (vir)) +#endif #endif /* _I386_ACONST_H */ diff -ru _/src/kernel/arch/i386/include/archtypes.h src/kernel/arch/i386/include/archtypes.h --- _/src/kernel/arch/i386/include/archtypes.h 2006-12-23 00:22:28.000000000 +0900 +++ src/kernel/arch/i386/include/archtypes.h 2010-11-11 00:00:00.000000000 +0900 @@ -17,6 +17,7 @@ * used for the larger registers to avoid differences in the code. */ struct stackframe_s { /* proc_ptr points here */ +#if 0 u16_t gs; /* last item pushed by save */ u16_t fs; /* ^ */ u16_t es; /* | */ @@ -35,6 +36,63 @@ reg_t psw; /* | */ reg_t sp; /* | */ reg_t ss; /* these are pushed by CPU during interrupt */ +#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_s +#endif +#endif }; struct segdesc_s { /* segment descriptor for protected mode */ diff -ru _/src/kernel/main.c src/kernel/main.c --- _/src/kernel/main.c 2007-03-31 00:17:32.000000000 +0900 +++ src/kernel/main.c 2010-11-11 00:00:00.000000000 +0900 @@ -112,10 +112,19 @@ /* The bootstrap loader created an array of the a.out headers at * absolute address 'aout'. Get one element to e_hdr. */ +#if 0 phys_copy(aout + hdrindex * A_MINHDR, vir2phys(&e_hdr), (phys_bytes) A_MINHDR); +#else /* patch */ + phys_copy(aout + hdrindex * sizeof(struct exec), vir2phys(&e_hdr), + (phys_bytes) sizeof(struct exec)); +#endif /* Convert addresses to clicks and build process memory map */ +#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; st_clicks= (e_hdr.a_total + CLICK_SIZE-1) >> CLICK_SHIFT; @@ -128,7 +137,11 @@ rp->p_memmap[T].mem_phys = text_base; rp->p_memmap[T].mem_len = text_clicks; rp->p_memmap[D].mem_phys = text_base + text_clicks; +#if 0 rp->p_memmap[D].mem_len = data_clicks; +#else /* patch */ + rp->p_memmap[D].mem_len = st_clicks; +#endif rp->p_memmap[S].mem_phys = text_base + text_clicks + st_clicks; rp->p_memmap[S].mem_vir = st_clicks; rp->p_memmap[S].mem_len = 0; @@ -144,9 +157,17 @@ * to give crtso.s something to use as "argc". */ if (isusern(proc_nr(rp))) { /* user-space process? */ +#if 0 +#else /* patch */ + rp->p_reg.pc = e_hdr.a_entry; +#endif +#if 0 rp->p_reg.sp = (rp->p_memmap[S].mem_vir + rp->p_memmap[S].mem_len) << CLICK_SHIFT; rp->p_reg.sp -= sizeof(reg_t); +#else /* patch */ + rp->p_reg.sp = 0; +#endif } /* Set ready. The HARDWARE task is never ready. */ @@ -169,7 +190,10 @@ */ bill_ptr = proc_addr(IDLE); /* it has to point somewhere */ announce(); /* print MINIX startup banner */ +#if 0 restart(); +#else /* patch */ +#endif } /*===========================================================================* diff -ru _/src/kernel/proc.c src/kernel/proc.c --- _/src/kernel/proc.c 2007-03-21 18:45:02.000000000 +0900 +++ src/kernel/proc.c 2010-11-11 00:00:00.000000000 +0900 @@ -76,10 +76,17 @@ break; \ } +#if 0 #define CopyMess(s,sp,sm,dp,dm) \ cp_mess(proc_addr(s)->p_endpoint, \ (sp)->p_memmap[D].mem_phys, \ (vir_bytes)sm, (dp)->p_memmap[D].mem_phys, (vir_bytes)dm) +#else /* patch */ +#define CopyMess(s,sp,sm,dp,dm) \ + cp_mess(proc_addr(s)->p_endpoint, \ + (sp)->p_memmap[D].mem_phys - (sp)->p_memmap[D].mem_vir, \ + (vir_bytes)sm, (dp)->p_memmap[D].mem_phys - (dp)->p_memmap[D].mem_vir, (vir_bytes)dm) +#endif /*===========================================================================* * sys_call * diff -ru _/src/kernel/start.c src/kernel/start.c --- _/src/kernel/start.c 2006-12-23 00:22:28.000000000 +0900 +++ src/kernel/start.c 2010-11-11 00:00:00.000000000 +0900 @@ -25,18 +25,62 @@ register char *value; /* value in key=value pair */ extern int etext, end; int h; +#if 0 +#else /* patch */ +#if defined(__arm__) + extern int __text_start; /* ToDo: linker script */ + extern int __data_start; +#elif defined(__mips__) + extern int _ftext; + extern int _fdata; +#else +#error cstart +#endif +#endif /* Record where the kernel and the monitor are. */ +#if 0 kinfo.code_base = seg2phys(cs); +#else /* patch */ +#if defined(__arm__) + kinfo.code_base = (phys_bytes)&__text_start; +#elif defined(__mips__) + kinfo.code_base = (phys_bytes)&_ftext; +#else +#error cstart +#endif +#endif +#if 0 kinfo.code_size = (phys_bytes) &etext; /* size of code segment */ +#else /* patch */ + kinfo.code_size = (phys_bytes) &etext - kinfo.code_base; /* size of code segment */ +#endif +#if 0 kinfo.data_base = seg2phys(ds); +#else /* patch */ +#if defined(__arm__) + kinfo.data_base = (phys_bytes)&__data_start; +#elif defined(__mips__) + kinfo.data_base = (phys_bytes)&_fdata; +#else +#error cstart +#endif +#endif +#if 0 kinfo.data_size = (phys_bytes) &end; /* size of data segment */ +#else /* patch */ + kinfo.data_size = (phys_bytes) &end - kinfo.data_base; /* size of data segment */ +#endif /* Architecture-dependent initialization. */ system_init(); /* Copy the boot parameters to the local buffer. */ +#if 0 kinfo.params_base = seg2phys(mds) + parmoff; +#else /* patch */ + kinfo.params_base = (phys_bytes)mds << 16 | parmoff; +#endif kinfo.params_size = MIN(parmsize,sizeof(params)-2); phys_copy(kinfo.params_base, vir2phys(params), kinfo.params_size); @@ -58,7 +102,10 @@ kloadinfo.proc_load_history[h] = 0; /* Processor? Decide if mode is protected for older machines. */ +#if 0 machine.processor=atoi(get_value(params, "processor")); +#else /* patch */ +#endif /* XT, AT or MCA bus? */ value = get_value(params, "bus"); @@ -69,9 +116,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 /* Return to assembler code to switch to protected mode (if 286), * reload selectors and call main(). diff -ru _/src/kernel/system/Makefile src/kernel/system/Makefile --- _/src/kernel/system/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/kernel/system/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -1,14 +1,17 @@ # Makefile for system library implementation -include /etc/make.conf +#include /etc/make.conf +include $(MINIX_SOURCE)/etc/make.conf # Directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include a = ../arch # Programs, flags, etc. -CC = exec cc $(CFLAGS) -c +#CC = exec cc $(CFLAGS) -c +CC = exec $(MINIX_GCC) $(CFLAGS) -c CCNOPROF = exec cc $(CFLAGSNOPROF) -c # no call profiling for these CPP = $l/cpp LD = $(CC) -.o @@ -56,7 +59,9 @@ $(SYSTEM)(do_profbuf.o) build $(SYSTEM): $(OBJECTS) - aal cr $@ *.o +# aal cr $@ *.o +# $(MINIX_GAR) cr $@ *.o + $(MINIX_GAR) cr $(SYSTEM) *.o clean: rm -f $(SYSTEM) *.o *~ *.bak @@ -65,7 +70,7 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend $(SYSTEM)(do_unused.o): do_unused.c diff -ru _/src/kernel/system/do_newmap.c src/kernel/system/do_newmap.c --- _/src/kernel/system/do_newmap.c 2007-02-02 02:50:02.000000000 +0900 +++ src/kernel/system/do_newmap.c 2010-11-11 00:00:00.000000000 +0900 @@ -50,6 +50,10 @@ (phys_bytes)sizeof(rp->p_memmap)); alloc_segments(rp); +#if 0 +#else /* patch */ + phys_copy(vir2phys(rp->p_memmap), src_phys, sizeof(rp->p_memmap)); +#endif return(OK); } diff -ru _/src/kernel/system/do_sigreturn.c src/kernel/system/do_sigreturn.c --- _/src/kernel/system/do_sigreturn.c 2006-12-23 00:22:28.000000000 +0900 +++ src/kernel/system/do_sigreturn.c 2010-11-11 00:00:00.000000000 +0900 @@ -38,9 +38,14 @@ if (src_phys == 0) return(EFAULT); phys_copy(src_phys, vir2phys(&sc), (phys_bytes) sizeof(struct sigcontext)); +#if 0 sc.sc_psw = rp->p_reg.psw; +#else /* patch */ + sc.sc_regs.psw = rp->p_reg.psw; +#endif #if (_MINIX_CHIP == _CHIP_INTEL) +#if 0 /* Don't panic kernel if user gave bad selectors. */ sc.sc_cs = rp->p_reg.cs; sc.sc_ds = rp->p_reg.ds; @@ -49,6 +54,8 @@ sc.sc_fs = rp->p_reg.fs; sc.sc_gs = rp->p_reg.gs; #endif +#else /* patch */ +#endif #endif /* Restore the registers. */ diff -ru _/src/kernel/system/do_sigsend.c src/kernel/system/do_sigsend.c --- _/src/kernel/system/do_sigsend.c 2007-02-02 02:50:02.000000000 +0900 +++ src/kernel/system/do_sigsend.c 2010-11-11 00:00:00.000000000 +0900 @@ -78,6 +78,7 @@ if (dst_phys == 0) return(EFAULT); phys_copy(vir2phys(&fr), dst_phys, (phys_bytes) sizeof(struct sigframe)); +#if 0 #if ( _MINIX_CHIP == _CHIP_POWERPC ) /* stuff that can't be done in the assembler code. */ /* When the signal handlers C code is called it will write this value * into the signal frame (over the sf_retadr value). @@ -87,9 +88,23 @@ */ rp->p_reg.retreg = smsg.sm_signo; /* note the retreg == first argument */ #endif +#else /* patch */ + rp->p_reg.lr = smsg.sm_sigreturn; +#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 /* 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; /* Reschedule if necessary. */ diff -ru _/src/kernel/system/do_trace.c src/kernel/system/do_trace.c --- _/src/kernel/system/do_trace.c 2007-02-02 02:50:02.000000000 +0900 +++ src/kernel/system/do_trace.c 2010-11-11 00:00:00.000000000 +0900 @@ -102,6 +102,7 @@ return(EIO); i = (int) tr_addr; #if (_MINIX_CHIP == _CHIP_INTEL) +#if 0 /* Altering segment registers might crash the kernel when it * tries to load them prior to restarting a process, so do * not allow it. @@ -115,6 +116,8 @@ #endif i == (int) &((struct proc *) 0)->p_reg.ss) return(EIO); +#else /* patch */ +#endif #endif if (i == (int) &((struct proc *) 0)->p_reg.psw) /* only selected bits are changeable */ diff -ru _/src/lib/Makefile src/lib/Makefile --- _/src/lib/Makefile 2007-03-31 00:36:50.000000000 +0900 +++ src/lib/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -67,8 +67,8 @@ cd dummy && $(MAKE) $@ mkdir -p obj-gnu/./editline cd editline && $(MAKE) $@ - mkdir -p obj-gnu/./end - cd end && $(MAKE) $@ +# mkdir -p obj-gnu/./end +# cd end && $(MAKE) $@ mkdir -p obj-gnu/./ip cd ip && $(MAKE) $@ mkdir -p obj-gnu/./math @@ -93,8 +93,8 @@ cd sysutil && $(MAKE) $@ mkdir -p obj-gnu/./timers cd timers && $(MAKE) $@ - mkdir -p obj-gnu/./i386 - cd i386 && $(MAKE) $@ +# mkdir -p obj-gnu/./i386 +# cd i386 && $(MAKE) $@ mkdir -p obj-gnu/./ack cd ack && $(MAKE) $@ mkdir -p obj-gnu/./gnu @@ -191,13 +191,13 @@ install: install-ack install-ack: all-ack - cp obj-ack//*.[ao] /usr/lib/i386 +# cp obj-ack//*.[ao] /usr/lib/i386 install-gnu: all-gnu - cp obj-gnu/*.[ao] /usr/gnu/lib +# cp obj-gnu/*.[ao] /usr/gnu/lib -include Makedepend-ack -include .depend-ack +#include Makedepend-ack +#include .depend-ack -include Makedepend-gnu -include .depend-gnu +#include Makedepend-gnu +#include .depend-gnu diff -ru _/src/lib/ansi/Makefile.in src/lib/ansi/Makefile.in --- _/src/lib/ansi/Makefile.in 2007-03-31 00:36:50.000000000 +0900 +++ src/lib/ansi/Makefile.in 2010-11-11 00:00:00.000000000 +0900 @@ -79,6 +79,8 @@ tolower.c \ toupper.c \ wcstombs.c \ - wctomb.c" + wctomb.c \ + memchr.c memcmp.c memcpy.c memmove.c memset.c \ + strcat.c strchr.c strcmp.c strcpy.c strlen.c strncat.c strncmp.c strncpy.c strrchr.c" TYPE=both diff -ru _/src/lib/generate.sh src/lib/generate.sh --- _/src/lib/generate.sh 2007-04-12 23:29:30.000000000 +0900 +++ src/lib/generate.sh 2010-11-11 00:00:00.000000000 +0900 @@ -3,7 +3,8 @@ set -e -. /etc/make.conf +#. /etc/make.conf +. $MINIX_SOURCE/etc/make.conf exec >Makefile exec 3>Makedepend-ack @@ -133,18 +134,23 @@ case $srcfile in *.s ) - echo " gcc $CFLAGS -E -x assembler-with-cpp -I. $srcfile | asmconv -mi386 ack gnu > $GNUBASE/$OBJDIR/$srcfile.gnu || true" - echo " gas -o $dstfile $GNUBASE/$OBJDIR/$srcfile.gnu" +# echo " gcc $CFLAGS -E -x assembler-with-cpp -I. $srcfile | asmconv -mi386 ack gnu > $GNUBASE/$OBJDIR/$srcfile.gnu || true" + echo " sed -e 's/^\.extern.*//' -e 's/^\.define._/.global /' -e 's/^_//' -e 's/^.jmp._/ b /' $srcfile > $GNUBASE/$OBJDIR/$srcfile.gnu || true" +# echo " gas -o $dstfile $GNUBASE/$OBJDIR/$srcfile.gnu" + echo " \$(MINIX_GCC) -x assembler-with-cpp $CFLAGS -I\$(MINIX_SOURCE)/include -c -o $dstfile $GNUBASE/$OBJDIR/$srcfile.gnu" echo " mkdep 'gcc $CFLAGS -E -x assembler-with-cpp -I.' $srcfile | $sedcmd >> .depend-gnu" >&4 ;; *.gs ) - echo " gas -o $dstfile $srcfile" +# echo " gas -o $dstfile $srcfile" + echo " \$(MINIX_GCC) -x assembler-with-cpp $CFLAGS -I\$(MINIX_SOURCE)/include -c -o $dstfile $srcfile" echo " mkdep 'gcc $CFLAGS -E -x assembler-with-cpp -I.' $srcfile | $sedcmd >> .depend-gnu" >&4 ;; - *.c ) - echo " gcc $CFLAGS -c -o $dstfile $srcfile" +# *.c ) + *.c | *.S ) +# echo " gcc $CFLAGS -c -o $dstfile $srcfile" + echo " \$(MINIX_GCC) $CFLAGS -I\$(MINIX_SOURCE)/include -c -o $dstfile $srcfile" echo " mkdep 'gcc $CFLAGS -E' $srcfile | $sedcmd >> .depend-gnu" >&4 ;; @@ -167,7 +173,8 @@ echo for f in $FILES { - o=`echo $f | sed -e 's/\\..*\$/\.o/'` +# o=`echo $f | sed -e 's/\\..*\$/\.o/'` + o=`echo $f | sed -e 's/.*\///' -e 's/\\..*\$/\.o/'` echo "$ACKBASE/$lib.a: $ACKBASE/$lib.a($o)" } echo @@ -177,7 +184,8 @@ echo for f in $FILES { - o=`echo $f | sed -e 's/\\..*\$/\.o/'` +# o=`echo $f | sed -e 's/\\..*\$/\.o/'` + o=`echo $f | sed -e 's/.*\///' -e 's/\\..*\$/\.o/'` echo "$ACKBASE/$lib.a($o): $f" ackCommands $ACKBASE/$OBJDIR/$o $f @@ -191,16 +199,19 @@ echo for f in $FILES { - o=`echo $f | sed -e 's/\\..*\$/\.o/'` +# o=`echo $f | sed -e 's/\\..*\$/\.o/'` + o=`echo $f | sed -e 's/.*\///' -e 's/\\..*\$/\.o/'` echo "$GNUBASE/$lib.a: $GNUBASE/$OBJDIR/$o" } echo echo "$GNUBASE/$lib.a:" - echo " gar cr $GNUBASE/$lib.a \$?" +# echo " gar cr $GNUBASE/$lib.a \$?" + echo " \$(MINIX_GAR) cr $GNUBASE/$lib.a \$?" echo for f in $FILES { - o=`echo $f | sed -e 's/\\..*\$/\.o/'` +# o=`echo $f | sed -e 's/\\..*\$/\.o/'` + o=`echo $f | sed -e 's/.*\///' -e 's/\\..*\$/\.o/'` echo "$GNUBASE/$OBJDIR/$o: $f" @@ -214,7 +225,8 @@ #start files for f in $STARTFILES { - o=`echo $f | sed -e 's/\\..*\$/\.o/'` +# o=`echo $f | sed -e 's/\\..*\$/\.o/'` + o=`echo $f | sed -e 's/.*\///' -e 's/\\..*\$/\.o/'` if [ $TYPE = "both" -o $TYPE = "ack" ]; then echo "all-ack: $ACKBASE/$o" @@ -248,15 +260,15 @@ echo echo "install-ack: all-ack" # $ARCH is from /etc/make.conf - echo " cp $ACKBASE/*.[ao] /usr/lib/$ARCH" +# echo " cp $ACKBASE/*.[ao] /usr/lib/$ARCH" echo echo "install-gnu: all-gnu" - echo " cp $GNUBASE/*.[ao] /usr/gnu/lib" +# echo " cp $GNUBASE/*.[ao] /usr/gnu/lib" fi echo -echo "include Makedepend-ack" -echo "include .depend-ack" +#echo "include Makedepend-ack" +#echo "include .depend-ack" echo -echo "include Makedepend-gnu" -echo "include .depend-gnu" +#echo "include Makedepend-gnu" +#echo "include .depend-gnu" diff -ru _/src/lib/gnu/rts/Makefile.in src/lib/gnu/rts/Makefile.in --- _/src/lib/gnu/rts/Makefile.in 2006-12-09 01:23:18.000000000 +0900 +++ src/lib/gnu/rts/Makefile.in 2010-11-11 00:00:00.000000000 +0900 @@ -3,6 +3,9 @@ libc_FILES=" \ __setjmp.gs \ - longjmp.gs" + longjmp.gs \ + ../../../\$(MINIX_CHIP)/__sigreturn.S ../../../\$(MINIX_CHIP)/_brksize.S ../../../\$(MINIX_CHIP)/crtso_core.c" +STARTFILES=" \ + ../../../\$(MINIX_CHIP)/crtso.S" TYPE=gnu diff -ru _/src/lib/gnu/rts/__setjmp.gs src/lib/gnu/rts/__setjmp.gs --- _/src/lib/gnu/rts/__setjmp.gs 2006-12-09 01:23:18.000000000 +0900 +++ src/lib/gnu/rts/__setjmp.gs 2010-11-11 00:00:00.000000000 +0900 @@ -1,3 +1,4 @@ +#if 0 / __setjmp.gnu.s / / Created: Oct 14, 1993 by Philip Homburg @@ -29,3 +30,39 @@ ret / $PchId: __setjmp.gnu.s,v 1.4 1996/03/12 19:30:54 philip Exp $ +#else /* patch */ +#if defined(__arm__) +#define OFFSET(a) ((a) * 4 + 8) + .text + .balign 4 + .global __setjmp +__setjmp: + 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) + .text + .balign 4 + .set at + .set reorder + .global __setjmp +__setjmp: + 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 _/src/lib/gnu/rts/longjmp.gs src/lib/gnu/rts/longjmp.gs --- _/src/lib/gnu/rts/longjmp.gs 2006-12-09 01:23:18.000000000 +0900 +++ src/lib/gnu/rts/longjmp.gs 2010-11-11 00:00:00.000000000 +0900 @@ -1,3 +1,4 @@ +#if 0 / longjmp.gnu.s / / Created: Oct 15, 1993 by Philip Homburg @@ -36,3 +37,46 @@ ret / $PchId: longjmp.gnu.s,v 1.4 1996/03/12 19:30:02 philip Exp $ +#else /* patch */ +#if defined(__arm__) +#define OFFSET(a) ((a) * 4 + 8) + .text + .balign 4 + .global longjmp +longjmp: + 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) + .text + .balign 4 + .set at + .set reorder + .global longjmp +longjmp: + 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 _/src/lib/sysutil/Makefile.in src/lib/sysutil/Makefile.in --- _/src/lib/sysutil/Makefile.in 2007-03-09 00:39:14.000000000 +0900 +++ src/lib/sysutil/Makefile.in 2010-11-11 00:00:00.000000000 +0900 @@ -4,6 +4,23 @@ LIBRARIES=libsysutil +#libsysutil_FILES=" \ +# kmalloc.c \ +# kprintf.c \ +# kputc.c \ +# tickdelay.c \ +# getuptime.c \ +# env_get_prm.c \ +# env_parse.c \ +# env_panic.c \ +# env_prefix.c \ +# fkey_ctl.c \ +# report.c \ +# taskcall.c \ +# read_tsc.s \ +# read_tsc_64.c \ +# profile_extern.c \ +# profile.c" libsysutil_FILES=" \ kmalloc.c \ kprintf.c \ @@ -17,7 +34,6 @@ fkey_ctl.c \ report.c \ taskcall.c \ - read_tsc.s \ read_tsc_64.c \ profile_extern.c \ profile.c" diff -ru _/src/servers/Makefile src/servers/Makefile --- _/src/servers/Makefile 2006-10-25 22:40:36.000000000 +0900 +++ src/servers/Makefile 2010-12-11 00:00:00.000000000 +0900 @@ -20,7 +20,7 @@ cd ./mfs && $(MAKE) $@ cd ./rs && $(MAKE) $@ cd ./ds && $(MAKE) $@ - cd ./is && $(MAKE) $@ +# cd ./is && $(MAKE) $@ cd ./init && $(MAKE) $@ cd ./inet && $(MAKE) $@ diff -ru _/src/servers/ds/Makefile src/servers/ds/Makefile --- _/src/servers/ds/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/servers/ds/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,7 +2,8 @@ SERVER = ds # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys m = $i/minix @@ -12,9 +13,12 @@ f = $u/src/servers/fs # programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CFLAGS = -I$i $(CPROFILE) -LDFLAGS = -i +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -lsys OBJ = main.o store.o @@ -22,12 +26,14 @@ # build local binary all build: $(SERVER) $(SERVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 16k $@ +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 16k $@ + elf2aout -v -S 16k $@.elf $@ # install with other servers install: $(SERVER) - install -o root -c $? /sbin/$(SERVER) +# install -o root -c $? /sbin/$(SERVER) # install -o root -cs $? $@ # clean up local files @@ -38,5 +44,5 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/servers/inet/Makefile src/servers/inet/Makefile --- _/src/servers/inet/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/servers/inet/Makefile 2010-12-11 00:00:00.000000000 +0900 @@ -4,10 +4,14 @@ g = generic # Programs, flags, and libraries -CC = cc -CPPFLAGS = -I. -D_MINIX +#CC = cc +CC = $(MINIX_GCC) +#CPPFLAGS = -I. -D_MINIX +CPPFLAGS = -I. -D_MINIX -I$(MINIX_SOURCE)/include CFLAGS = $(OPT) $(CPPFLAGS) $(CPROFILE) -LDFLAGS = +#LDFLAGS = +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -lsys .c.o: @@ -26,10 +30,12 @@ all: inet inet: $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) version.c $(LIBS) +# $(CC) -o $@ $(LDFLAGS) $(OBJ) version.c $(LIBS) + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ version.c $(LOADLIBES) $(LDLIBS) -o $@.elf + elf2aout -v $@.elf $@ install: inet - install -c $? /usr/sbin/inet +# install -c $? /usr/sbin/inet clean: rm -f $(OBJ) inet *.bak @@ -38,7 +44,7 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c generic/*.c > .depend # Include generated dependencies. -include .depend +#include .depend # # $PchId: Makefile.mnx3,v 1.1 2005/06/28 14:28:45 philip Exp $ diff -ru _/src/servers/inet/stacktrace.c src/servers/inet/stacktrace.c --- _/src/servers/inet/stacktrace.c 2005-04-21 23:53:54.000000000 +0900 +++ src/servers/inet/stacktrace.c 2010-12-11 00:00:00.000000000 +0900 @@ -14,7 +14,11 @@ reg_t bp, pc, hbp; extern reg_t get_bp ARGS(( void )); +#if 0 bp= get_bp(); +#else /* patch */ + bp= 0; /* ToDo: frame pointer */ +#endif while(bp) { pc= ((reg_t *)bp)[1]; diff -ru _/src/servers/init/Makefile src/servers/init/Makefile --- _/src/servers/init/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/servers/init/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,29 +2,35 @@ SERVER = init # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys h = $i/minix k = $u/src/kernel # programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CFLAGS = -I$i -O -D_MINIX -D_POSIX_SOURCE -LDFLAGS = -i +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc OBJ = init.o # build local binary all build: $(SERVER) $(SERVER): $(OBJ) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJ) -lsysutil - install -S 8k $@ +# $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJ) -lsysutil + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 8k $@ + elf2aout -v -S 8k $@.elf $@ # install with other servers install: /usr/sbin/$(SERVER) /usr/sbin/$(SERVER): $(SERVER) - install -o root -cs $? $@ +# install -o root -cs $? $@ # clean up local files clean: @@ -34,5 +40,5 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/servers/mfs/Makefile src/servers/mfs/Makefile --- _/src/servers/mfs/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/servers/mfs/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,15 +2,19 @@ SERVER = mfs # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys h = $i/minix # programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CFLAGS = -I$i $(EXTRA_OPTS) $(CPROFILE) -LDFLAGS = -i +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libtimers.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -lsys -ltimers OBJ = cache.o device.o link.o \ @@ -21,11 +25,13 @@ # build local binary all build: $(SERVER) $(SERVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 64k $(SERVER) +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 64k $(SERVER) + elf2aout -v -S 64k $@.elf $@ install: $(SERVER) - install $(SERVER) /sbin/$(SERVER) +# install $(SERVER) /sbin/$(SERVER) # clean up local files clean: @@ -35,6 +41,6 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/servers/mfs/path.c src/servers/mfs/path.c --- _/src/servers/mfs/path.c 2007-04-13 23:00:32.000000000 +0900 +++ src/servers/mfs/path.c 2010-12-11 00:00:00.000000000 +0900 @@ -71,7 +71,11 @@ rip = parse_path(user_path, string, flags); /* Copy back the last name if it is required */ +#if 0 if (err_code != OK || (flags & PATH_PENULTIMATE)) { +#else /* patch */ + if ((err_code != OK || (flags & PATH_PENULTIMATE)) && fs_m_in.REQ_USER_ADDR != NULL) { +#endif s_error = sys_datacopy(SELF_E, (vir_bytes) string, FS_PROC_NR, (vir_bytes) fs_m_in.REQ_USER_ADDR, (phys_bytes) NAME_MAX); if (s_error != OK) { diff -ru _/src/servers/pm/Makefile src/servers/pm/Makefile --- _/src/servers/pm/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/servers/pm/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -1,20 +1,25 @@ # Makefile for Process Manager (PM) SERVER = pm -include /etc/make.conf +#include /etc/make.conf +include $(MINIX_SOURCE)/etc/make.conf # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys h = $i/minix k = $u/src/kernel # programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CPPFLAGS=-I../../kernel/arch/$(ARCH)/include -I$i CFLAGS = $(CPROFILE) $(CPPFLAGS) -LDFLAGS = -i +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libtimers.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc OBJ = main.o forkexit.o break.o exec.o time.o timers.o \ signal.o alloc.o utility.o table.o trace.o getset.o misc.o \ @@ -23,13 +28,15 @@ # build local binary all build: $(SERVER) $(SERVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) -lsysutil -lsys -ltimers - install -S 8k $@ +# $(CC) -o $@ $(LDFLAGS) $(OBJ) -lsysutil -lsys -ltimers + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 8k $@ + elf2aout -v -S 8k $@.elf $@ # install with other servers install: /usr/sbin/$(SERVER) /usr/sbin/$(SERVER): $(SERVER) - install -o root -cs $? $@ +# install -o root -cs $? $@ # clean up local files clean: @@ -39,5 +46,5 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/servers/pm/exec.c src/servers/pm/exec.c --- _/src/servers/pm/exec.c 2006-05-11 23:57:24.000000000 +0900 +++ src/servers/pm/exec.c 2010-11-11 00:00:00.000000000 +0900 @@ -159,6 +159,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; } @@ -231,7 +236,11 @@ 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 _/src/servers/pm/main.c src/servers/pm/main.c --- _/src/servers/pm/main.c 2007-02-17 00:55:20.000000000 +0900 +++ src/servers/pm/main.c 2010-11-11 00:00:00.000000000 +0900 @@ -347,7 +347,10 @@ #endif /* ENABLE_BOOTDEV */ /* Withhold some memory from x86 VM */ +#if 0 do_x86_vm(mem_chunks); +#else /* patch */ +#endif /* Initialize tables to all physical memory and print memory information. */ printf("Physical memory:"); @@ -357,8 +360,11 @@ printf(" system %u KB,", click_to_round_k(minix_clicks)); printf(" free %u KB.\n", click_to_round_k(free_clicks)); #if (CHIP == INTEL) +#if 0 uts_val.machine[0] = 'i'; strcpy(uts_val.machine + 1, itoa(getprocessor())); +#else /* patch */ +#endif #endif } @@ -407,7 +413,11 @@ if (limit <= base) { memp->base = memp->size = 0; } else { +#if 0 memp->base = base >> CLICK_SHIFT; +#else /* patch */ + memp->base = (unsigned long)base >> CLICK_SHIFT; +#endif memp->size = (limit - base) >> CLICK_SHIFT; } } @@ -429,8 +439,13 @@ struct memory *memp; for (memp = mem_chunks; memp < &mem_chunks[NR_MEMS]; memp++) { if (memp->base == map_ptr[T].mem_phys) { +#if 0 memp->base += map_ptr[T].mem_len + map_ptr[S].mem_vir; memp->size -= map_ptr[T].mem_len + map_ptr[S].mem_vir; +#else /* patch */ + memp->base += map_ptr[T].mem_len + map_ptr[D].mem_len; + memp->size -= map_ptr[T].mem_len + map_ptr[D].mem_len; +#endif break; } } diff -ru _/src/servers/pm/misc.c src/servers/pm/misc.c --- _/src/servers/pm/misc.c 2007-02-17 00:55:20.000000000 +0900 +++ src/servers/pm/misc.c 2010-11-11 00:00:00.000000000 +0900 @@ -40,7 +40,11 @@ #if __i386 "i386", /* architecture */ #else +#if 0 #error /* oops, no 'uname -mk' */ +#else /* patch */ + "", +#endif #endif }; diff -ru _/src/servers/pm/mproc.h src/servers/pm/mproc.h --- _/src/servers/pm/mproc.h 2006-10-25 20:29:44.000000000 +0900 +++ src/servers/pm/mproc.h 2010-11-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 _/src/servers/rs/Makefile src/servers/rs/Makefile --- _/src/servers/rs/Makefile 2007-02-24 03:22:46.000000000 +0900 +++ src/servers/rs/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,20 +2,25 @@ SERVER = rs UTIL = service -include /etc/make.conf +#include /etc/make.conf +include $(MINIX_SOURCE)/etc/make.conf # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys m = $i/minix b = $i/ibm # programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CPPFLAGS = -I../../kernel/arch/$(ARCH)/include CFLAGS = -I$i $(CPROFILE) $(CPPFLAGS) -LDFLAGS = -i +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsys -lsysutil UTIL_OBJ = service.o @@ -24,17 +29,22 @@ # build local binary all build: $(SERVER) $(UTIL) $(UTIL): $(UTIL_OBJ) - $(CC) -o $@ $(LDFLAGS) $(UTIL_OBJ) $(UTIL_LIBS) +# $(CC) -o $@ $(LDFLAGS) $(UTIL_OBJ) $(UTIL_LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf + elf2aout -v $@.elf $@ $(SERVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 120k $@ +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) +# $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(LDLIBS) -o $@.elf + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(LDLIBS) -o $@.elf +# install -S 120k $@ + elf2aout -v -S 120k $@.elf $@ # install with other servers install: /bin/$(UTIL) /usr/sbin/$(SERVER) /bin/$(UTIL): $(UTIL) - install -c $? $@ +# install -c $? $@ /usr/sbin/$(SERVER): $(SERVER) - install -o root -c $? $@ +# install -o root -c $? $@ # clean up local files clean: @@ -44,5 +54,5 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/servers/rs/exec.c src/servers/rs/exec.c --- _/src/servers/rs/exec.c 2006-05-11 23:58:34.000000000 +0900 +++ src/servers/rs/exec.c 2010-11-11 00:00:00.000000000 +0900 @@ -9,17 +9,31 @@ vir_bytes *text_bytes, vir_bytes *data_bytes, vir_bytes *bss_bytes, phys_bytes *tot_bytes, vir_bytes *pc, int *hdrlenp) ); +#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 exec_restart, (int proc_e, int result) ); FORWARD _PROTOTYPE( void patch_ptr, (char stack[ARG_MAX], vir_bytes base) ); +#if 0 FORWARD _PROTOTYPE( int read_seg, (char *exec, size_t exec_len, off_t off, int proc_e, int seg, phys_bytes seg_bytes) ); +#else /* patch */ +FORWARD _PROTOTYPE( int read_seg, (char *exec, size_t exec_len, off_t off, + int proc_e, int seg, phys_bytes seg_bytes, phys_bytes seg_base) ); +#endif static int self_e= NONE; @@ -154,10 +168,17 @@ new_uid= getuid(); new_gid= getgid(); /* XXX what should we use to identify the executable? */ +#if 0 r= exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, frame_len, sep_id, 0 /*dev*/, proc_e /*inum*/, 0 /*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, 0 /*dev*/, proc_e /*inum*/, 0 /*ctime*/, + progname, new_uid, new_gid, &stack_top, &load_text, + &allow_setuid, &pc); +#endif if (r != OK) { printf("do_exec: exec_newmap failed: %d\n", r); @@ -177,7 +198,11 @@ /* Read in text and data segments. */ if (load_text) { +#if 0 r= read_seg(exec, exec_len, off, proc_e, T, text_bytes); +#else /* patch */ + r= read_seg(exec, exec_len, off, proc_e, T, text_bytes, pc); +#endif if (r != OK) { printf("do_exec: read_seg failed: %d\n", r); @@ -189,7 +214,11 @@ printf("do_exec: not loading text segment\n"); off += text_bytes; +#if 0 r= read_seg(exec, exec_len, off, proc_e, D, data_bytes); +#else /* patch */ + r= read_seg(exec, exec_len, off, proc_e, D, data_bytes, pc + text_bytes); +#endif if (r != OK) { printf("do_exec: read_seg failed: %d\n", r); @@ -210,9 +239,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; @@ -229,6 +264,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; @@ -251,6 +290,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; @@ -261,6 +304,10 @@ *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 +#if 0 printf("exec_newmem: stack_top = 0x%x\n", *stack_topp); printf("exec_newmem: load_text = %d\n", *load_textp); #endif @@ -348,7 +395,10 @@ if (hdr.a_cpu != A_I8086) return(ENOEXEC); #endif #if (CHIP == INTEL && _WORD_SIZE == 4) +#if 0 if (hdr.a_cpu != A_I80386) return(ENOEXEC); +#else /* patch */ +#endif #endif if ((hdr.a_flags & ~(A_NSYM | A_EXEC | A_SEP)) != 0) return(ENOEXEC); @@ -407,13 +457,21 @@ /*===========================================================================* * read_seg * *===========================================================================*/ +#if 0 PRIVATE int read_seg(exec, exec_len, off, proc_e, seg, seg_bytes) +#else /* patch */ +PRIVATE int read_seg(exec, exec_len, off, proc_e, seg, seg_bytes, seg_base) +#endif char *exec; /* executable image */ size_t exec_len; /* size of the image */ 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 @@ -425,7 +483,11 @@ off_t n, o, b_off, seg_off; if (off+seg_bytes > exec_len) return ENOEXEC; +#if 0 r= sys_vircopy(SELF, D, (vir_bytes)exec+off, proc_e, seg, 0, seg_bytes); +#else /* patch */ + r= sys_vircopy(SELF, D, (vir_bytes)exec+off, proc_e, seg, seg_base, seg_bytes); +#endif return r; } diff -ru _/src/servers/rs/manager.c src/servers/rs/manager.c --- _/src/servers/rs/manager.c 2007-05-01 22:29:50.000000000 +0900 +++ src/servers/rs/manager.c 2010-11-11 00:00:00.000000000 +0900 @@ -720,10 +720,22 @@ setuid(rp->r_uid); if (!use_copy) { +#if 0 +#else /* patch */ + char *e[] = { NULL }; +#endif rp->r_argv[0] = rp->r_label; +#if 0 execve(rp->r_file, rp->r_argv, NULL); /* POSIX execute */ +#else /* patch */ + execve(rp->r_file, rp->r_argv, e); /* POSIX execute */ +#endif file_only = strrchr(rp->r_file, '/') + 1; +#if 0 execve(file_only, rp->r_argv, NULL); /* POSIX execute */ +#else /* patch */ + execve(file_only, rp->r_argv, e); /* POSIX execute */ +#endif } printf("RS: exec failed for %s: %d\n", rp->r_argv[0], errno); exit(EXEC_FAILED); /* terminate child */ @@ -1063,7 +1075,11 @@ if(rs_verbose) printf("RS: init_pci: calling pci_set_acl\n"); +#if 0 r= pci_set_acl(&rs_pci); +#else /* patch */ + r= OK; +#endif if(rs_verbose) printf("RS: init_pci: after pci_set_acl\n"); diff -ru _/src/servers/rs/service.c src/servers/rs/service.c --- _/src/servers/rs/service.c 2007-02-24 03:22:46.000000000 +0900 +++ src/servers/rs/service.c 2010-11-11 00:00:00.000000000 +0900 @@ -82,7 +82,11 @@ PRIVATE int do_run= 0; /* 'run' command instead of 'up' */ PRIVATE char *req_label; PRIVATE char *req_path; +#if 0 PRIVATE char *req_args; +#else /* patch */ +PRIVATE char *req_args = ""; +#endif PRIVATE int req_major; PRIVATE long req_period; PRIVATE char *req_script; diff -ru _/src/servers/vfs/Makefile src/servers/vfs/Makefile --- _/src/servers/vfs/Makefile 2007-02-09 01:26:20.000000000 +0900 +++ src/servers/vfs/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -2,15 +2,19 @@ SERVER = vfs # directories -u = /usr +#u = /usr +u = $(MINIX_SOURCE) i = $u/include s = $i/sys h = $i/minix # programs, flags, etc. -CC = exec cc +#CC = exec cc +CC = exec $(MINIX_GCC) CFLAGS = -I$i $(EXTRA_OPTS) $(CPROFILE) -LDFLAGS = -i +#LDFLAGS = -i +LDFLAGS = -Wl,-Map,$@.map -Wl,--cref -Wl,-e,crtso -Wl,-Ttext,$(MINIX_PROCESS) $(MINIX_SOURCE)/lib/obj-gnu/crtso.o +LDLIBS = $(MINIX_SOURCE)/lib/obj-gnu/libsysutil.a $(MINIX_SOURCE)/lib/obj-gnu/libsys.a $(MINIX_SOURCE)/lib/obj-gnu/libtimers.a $(MINIX_SOURCE)/lib/obj-gnu/libc.a -nostdlib -lgcc LIBS = -lsysutil -lsys -ltimers OBJ = main.o open.o read.o write.o pipe.o dmap.o \ @@ -23,8 +27,10 @@ install all build: $(SERVER) $(SERVER): $(OBJ) - $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) - install -S 16k $@ +# $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@.elf +# install -S 16k $@ + elf2aout -v -S 16k $@.elf $@ # clean up local files clean: @@ -34,4 +40,4 @@ mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend # Include generated dependencies. -include .depend +#include .depend diff -ru _/src/servers/vfs/exec.c src/servers/vfs/exec.c --- _/src/servers/vfs/exec.c 2007-04-13 23:00:32.000000000 +0900 +++ src/servers/vfs/exec.c 2010-11-11 00:00:00.000000000 +0900 @@ -34,12 +34,21 @@ #include "vmnt.h" #include +#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 vnode *vp, int *sep_id, vir_bytes *text_bytes, vir_bytes *data_bytes, vir_bytes *bss_bytes, phys_bytes *tot_bytes, vir_bytes *pc, @@ -50,8 +59,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 vnode *vp, off_t off, int proc_e, int seg, phys_bytes seg_bytes) ); +#else /* patch */ +FORWARD _PROTOTYPE( int read_seg, (struct vnode *vp, 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. */ @@ -209,9 +223,15 @@ return ENOEXEC; } +#if 0 r= exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, frame_len, sep_id, vp->v_dev, vp->v_inode_nr, v_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, vp->v_dev, vp->v_inode_nr, v_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); @@ -231,11 +251,19 @@ /* Read in text and data segments. */ if (load_text) { +#if 0 r= read_seg(vp, off, proc_e, T, text_bytes); +#else /* patch */ + r= read_seg(vp, off, proc_e, T, text_bytes, pc); +#endif } off += text_bytes; if (r == OK) +#if 0 r= read_seg(vp, off, proc_e, D, data_bytes); +#else /* patch */ + r= read_seg(vp, off, proc_e, D, data_bytes, pc + text_bytes); +#endif put_vnode(vp); @@ -266,9 +294,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; @@ -285,6 +319,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; @@ -307,6 +345,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; @@ -317,6 +359,10 @@ *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 +#if 0 printf("exec_newmem: stack_top = 0x%x\n", *stack_topp); printf("exec_newmem: load_text = %d\n", *load_textp); #endif @@ -401,7 +447,10 @@ if (hdr.a_cpu != A_I8086) return(ENOEXEC); #endif #if (CHIP == INTEL && _WORD_SIZE == 4) +#if 0 if (hdr.a_cpu != A_I80386) return(ENOEXEC); +#else /* patch */ +#endif #endif if ((hdr.a_flags & ~(A_NSYM | A_EXEC | A_SEP)) != 0) return(ENOEXEC); @@ -592,12 +641,20 @@ /*===========================================================================* * read_seg * *===========================================================================*/ +#if 0 PRIVATE int read_seg(vp, off, proc_e, seg, seg_bytes) +#else /* patch */ +PRIVATE int read_seg(vp, off, proc_e, seg, seg_bytes, seg_base) +#endif struct vnode *vp; /* 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 @@ -619,7 +676,11 @@ req.seg = seg; req.pos = cvul64(off); req.num_of_bytes = seg_bytes; +#if 0 req.user_addr = 0; +#else /* patch */ + req.user_addr = seg_base; +#endif req.inode_index = vp->v_index; /* Issue request */ diff -ru _/src/tools/Makefile src/tools/Makefile --- _/src/tools/Makefile 2007-04-13 00:13:10.000000000 +0900 +++ src/tools/Makefile 2010-11-11 00:00:00.000000000 +0900 @@ -52,17 +52,19 @@ cd ../kernel && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) cd ../servers && $(MAKE) image cd ../drivers && $(MAKE) image - installboot -image $@ $(PROGRAMS) +# installboot -image $@ $(PROGRAMS) + mkimage -image $@ $(PROGRAMS) image_small: includes cd ../kernel && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) cd ../servers && $(MAKE) EXTRA_OPTS=-D_MINIX_SMALL=1 image cd ../drivers && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) image - installboot -image $@ $(PROGRAMS) +# installboot -image $@ $(PROGRAMS) + mkimage -image $@ $(PROGRAMS) # rebuild the program or system libraries includes: - cd ../include && $(MAKE) install +# cd ../include && $(MAKE) install depend: includes cd ../ && $(MAKE) depend