[PATCH]- big patch that fixes bugs

Tommy McCabe
2004-05-28T20:22:12Z

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

This patch fixes so many bugs I can't remember them
all. When applied, ELKS will compile, but not boot
(sys_execve and sys_open return 2 and 8 errors- YES I
CHECKED THE FLOPPY). 2 bugs I noticed-

1. How do you get ash on comb but not on root?
2. How do you fit everything on root?

__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff; name="patch.diff", Size: 86731 bytes --]

diff -ruN ./elks-stuff/elks/arch/i86/Makefile ./elks/elks/arch/i86/Makefile
--- ./elks-stuff/elks/arch/i86/Makefile 2004-05-28 16:01:49.000000000 -0400
+++ ./elks/elks/arch/i86/Makefile 2004-04-18 14:45:26.000000000 -0400
@@ -105,9 +105,10 @@

boot/system: $(AARCHIVES) $(ADRIVERS) boot/crt1.o boot/crt0.o
(cd $(BASEDIR) ; $(LD) $(LDFLAGS) $(ARCH_LD) \
+ -t -M -o $(ARCH_DIR)/boot/system \
$(ARCH_DIR)/boot/crt0.o $(ARCH_DIR)/boot/crt1.o \
init/main.o $(ARCHIVES) $(DRIVERS) \
- -t -M -o $(ARCH_DIR)/boot/system > System.tmp ; \
+ > System.tmp ; \
sort -k4 System.tmp > System.map ; rm -f System.tmp )

#PC image build
diff -ruN ./elks-stuff/elks/arch/i86/boot/setup.S ./elks/elks/arch/i86/boot/setup.S
--- ./elks-stuff/elks/arch/i86/boot/setup.S 2004-05-28 16:01:49.000000000 -0400
+++ ./elks/elks/arch/i86/boot/setup.S 2004-04-18 14:42:59.000000000 -0400
@@ -585,7 +585,7 @@
or al,al
jnz is486
#endif
-#ifdef(CONFIG_CPU_80386)
+#ifdef CONFIG_CPU_80386
mov cl,#7
lea si,p80386
br getfpu
diff -ruN ./elks-stuff/elks/init/main.c ./elks/elks/init/main.c
--- ./elks-stuff/elks/init/main.c 2004-05-28 16:01:50.000000000 -0400
+++ ./elks/elks/init/main.c 2004-05-09 11:05:45.000000000 -0400
@@ -106,7 +106,7 @@
#ifdef CONFIG_CONSOLE_SERIAL
num = sys_open("/dev/ttyS0", 2, 0);
#else
- num = sys_open("/dev/tty1", 2, 0);
+ num = sys_open("/dev/tty0", 2, 0);
#endif

if (num < 0)
diff -ruN ./elks-stuff/elks/kernel/printk.c ./elks/elks/kernel/printk.c
--- ./elks-stuff/elks/kernel/printk.c 2004-05-28 16:01:50.000000000 -0400
+++ ./elks/elks/kernel/printk.c 2004-04-18 14:38:48.000000000 -0400
@@ -136,7 +136,7 @@
continue;
}

- width = zero = '0';
+ width = zero = 0;
if (c == '0')
zero++;
while (c >= '0' && c <= '9') {
diff -ruN ./elks-stuff/elkscmd/MAKEDEV ./elks/elkscmd/MAKEDEV
--- ./elks-stuff/elkscmd/MAKEDEV 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/MAKEDEV 2004-05-28 15:31:49.000000000 -0400
@@ -0,0 +1,266 @@
+#!/bin/sh
+
+# Devices are generated by this script in the same order that they are listed
+# in the Documentation/devices.txt file in the Linux 2.4.18 and5.21 kernel
+# sources. This includes devices that are not currently relevant to ELKS, to
+# encourage the use of common node numbers when these devices are eventually
+# implemented.
+#
+# Where different node numbers are currently used by ELKS, the current ELKS
+# node numbers are generated by lines labelled "Currently" and the relevant
+# Linux node numbers are generated by lines labelled "Ought to be".
+#
+# Refer to the MAKESET command, also in this directory, for usage details.
+
+LINK=ln
+MKDEV=mknod
+MKSET=./MAKESET
+TARGET_MNT=/mnt/test
+DEVDIR=./$TARGET_MNT/dev
+
+##############################################################################
+# Ensure required auxilliary script is present.
+
+if ! test -f "$MKSET"
+then
+ echo ERROR: \"$MKSET\" script missing, unable to continue.
+ exit 1
+fi
+
+##############################################################################
+# Create memory devices.
+
+ $MKDEV $DEVDIR/mem c 1 1
+ $MKDEV $DEVDIR/kmem c 1 2
+ $MKDEV $DEVDIR/null c 1 3
+# $MKDEV $DEVDIR/port c 1 4
+ $MKDEV $DEVDIR/zero c 1 5
+# $MKDEV $DEVDIR/core c 1 6
+ $MKDEV $DEVDIR/full c 1 7
+# $MKDEV $DEVDIR/random c 1 8
+# $MKDEV $DEVDIR/urandom c 1 9
+# $MKDEV $DEVDIR/aio c 1 10
+
+##############################################################################
+# RAM disks.
+
+ $MKSET 0 7 $MKDEV $DEVDIR/ram b 1
+
+ $LINK $DEVDIR/ram1 $DEVDIR/ramdisk
+
+##############################################################################
+# Pseudo-TTY master devices. These are not yet supported by the ELKS kernel.
+
+# $MKSET 0 15 $MKDEV $DEVDIR/ptyp x 2
+# $MKSET 16 15 $MKDEV $DEVDIR/ptyq x 2
+# $MKSET 32 15 $MKDEV $DEVDIR/ptyr x 2
+# $MKSET 48 15 $MKDEV $DEVDIR/ptys x 2
+# $MKSET 64 15 $MKDEV $DEVDIR/ptyt x 2
+# $MKSET 80 15 $MKDEV $DEVDIR/ptyu x 2
+# $MKSET 96 15 $MKDEV $DEVDIR/ptyv x 2
+# $MKSET 112 15 $MKDEV $DEVDIR/ptyw x 2
+# $MKSET 128 15 $MKDEV $DEVDIR/ptyx x 2
+# $MKSET 144 15 $MKDEV $DEVDIR/ptyy x 2
+# $MKSET 160 15 $MKDEV $DEVDIR/ptyz x 2
+# $MKSET 176 15 $MKDEV $DEVDIR/ptya x 2
+# $MKSET 192 15 $MKDEV $DEVDIR/ptyb x 2
+# $MKSET 208 15 $MKDEV $DEVDIR/ptyc x 2
+# $MKSET 224 15 $MKDEV $DEVDIR/ptyd x 2
+# $MKSET 240 15 $MKDEV $DEVDIR/ptye x 2
+
+##############################################################################
+# Floppy diskettes. Only the auto-detect nodes are listed.
+
+ $MKDEV $DEVDIR/fd0 b 3 128 # Currently.
+ $MKDEV $DEVDIR/fd1 b 3 192 # Currently.
+
+# $MKSET 0 3 $MKDEV $DEVDIR/fd b 2 # Ought to be.
+
+##############################################################################
+# Pseudo-TTY master devices. These are not yet supported by the ELKS kernel.
+
+# $MKSET 0 15 $MKDEV $DEVDIR/ttyp x 3
+# $MKSET 16 15 $MKDEV $DEVDIR/ttyq x 3
+# $MKSET 32 15 $MKDEV $DEVDIR/ttyr x 3
+# $MKSET 48 15 $MKDEV $DEVDIR/ttys x 3
+# $MKSET 64 15 $MKDEV $DEVDIR/ttyt x 3
+# $MKSET 80 15 $MKDEV $DEVDIR/ttyu x 3
+# $MKSET 96 15 $MKDEV $DEVDIR/ttyv x 3
+# $MKSET 112 15 $MKDEV $DEVDIR/ttyw x 3
+# $MKSET 128 15 $MKDEV $DEVDIR/ttyx x 3
+# $MKSET 144 15 $MKDEV $DEVDIR/ttyy x 3
+# $MKSET 160 15 $MKDEV $DEVDIR/ttyz x 3
+# $MKSET 176 15 $MKDEV $DEVDIR/ttya x 3
+# $MKSET 192 15 $MKDEV $DEVDIR/ttyb x 3
+# $MKSET 208 15 $MKDEV $DEVDIR/ttyc x 3
+# $MKSET 224 15 $MKDEV $DEVDIR/ttyd x 3
+# $MKSET 240 15 $MKDEV $DEVDIR/ttye x 3
+
+##############################################################################
+# Direct IDE disks, Primary channel.
+
+ $MKSET 0 7 $MKDEV $DEVDIR/hda b 5 # Currently.
+ $MKSET 8 7 $MKDEV $DEVDIR/hdb b 5 # Currently.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/hda b 3 # Ought to be.
+# $MKSET 8 7 $MKDEV $DEVDIR/hdb b 3 # Ought to be.
+
+##############################################################################
+# Virtual consoles. Note that tty4 through tty7 can't be enabled at this
+# time because of the possible conflict with ttyS0 through ttyS3 which
+# used to use the node numbers these now use. However, it is expected that
+# this restriction can be removed in the near future.
+
+ $MKSET 0 3 $MKDEV $DEVDIR/tty c 4 # Currently
+# $MKSET 0 15 $MKDEV $DEVDIR/tty c 4 # Soon to be
+
+# Serial ports, as detected by the ROM BIOS.
+
+ $MKSET 64 3 $MKDEV $DEVDIR/ttyS c 4
+
+##############################################################################
+# Alternate TTY devices. These are not yet supported.
+
+# $MKDEV $DEVDIR/tty c 5 0
+# $MKDEV $DEVDIR/console c 5 1
+# $MKDEV $DEVDIR/ptmx c 5 2
+
+##############################################################################
+# Parallel devices, as detected by the ROM BIOS.
+
+ $MKSET 0 3 $MKDEV $DEVDIR/lp c 6
+
+##############################################################################
+# Loopback devices. These are not yet supported.
+
+# $MKSET 0 15 $MKDEV $DEVDIR/loop c 7
+
+##############################################################################
+# SCSI disks. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/sda b 8
+# $MKSET 8 7 $MKDEV $DEVDIR/sdb b 8
+# $MKSET 16 7 $MKDEV $DEVDIR/sdc b 8
+# $MKSET 24 7 $MKDEV $DEVDIR/sdd b 8
+# $MKSET 32 7 $MKDEV $DEVDIR/sde b 8
+# $MKSET 40 7 $MKDEV $DEVDIR/sdf b 8
+# $MKSET 48 7 $MKDEV $DEVDIR/sdg b 8
+# $MKSET 56 7 $MKDEV $DEVDIR/sdh b 8
+# $MKSET 64 7 $MKDEV $DEVDIR/sdi b 8
+# $MKSET 72 7 $MKDEV $DEVDIR/sdj b 8
+# $MKSET 80 7 $MKDEV $DEVDIR/sdk b 8
+# $MKSET 88 7 $MKDEV $DEVDIR/sdl b 8
+# $MKSET 96 7 $MKDEV $DEVDIR/sdm b 8
+# $MKSET 104 7 $MKDEV $DEVDIR/sdn b 8
+# $MKSET 112 7 $MKDEV $DEVDIR/sdo b 8
+# $MKSET 120 7 $MKDEV $DEVDIR/sdp b 8
+
+##############################################################################
+# SCSI tapes. These are not yet supported.
+
+# $MKSET 0 31 $MKDEV $DEVDIR/st c 9
+# $MKSET 32 31 $MKDEV $DEVDIR/st c 9 l
+# $MKSET 64 31 $MKDEV $DEVDIR/st c 9 m
+# $MKSET 96 31 $MKDEV $DEVDIR/st c 9 a
+# $MKSET 128 31 $MKDEV $DEVDIR/nst c 9
+# $MKSET 160 31 $MKDEV $DEVDIR/nst c 9 l
+# $MKSET 192 31 $MKDEV $DEVDIR/nst c 9 m
+# $MKSET 224 31 $MKDEV $DEVDIR/nst c 9 a
+
+##############################################################################
+# Metadisk (RAID) devices. These are not yet supported.
+
+# $MKSET 0 15 $MKDEV $DEVDIR/md b 9
+
+##############################################################################
+# SCSI CD-ROM devices. These are not yet supported.
+
+# $MKDEV $DEVDIR/scd b 11
+
+##############################################################################
+# MSCDEX CD-ROM devices. These are not yet supported.
+
+# $MKDEV $DEVDIR/doscd b 12
+
+##############################################################################
+# 8-bit MFM/RLL controllers. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/xda b 13
+# $MKSET 8 7 $MKDEV $DEVDIR/xdb b 13
+
+##############################################################################
+# BIOS hard disks.
+
+ $MKSET 0 7 $MKDEV $DEVDIR/bda b 3 # Currently
+ $MKSET 8 7 $MKDEV $DEVDIR/bdb b 3 # Currently
+ $MKSET 16 7 $MKDEV $DEVDIR/bdc b 3 # Currently
+ $MKSET 24 7 $MKDEV $DEVDIR/bdd b 3 # Currently
+
+# $MKSET 0 7 $MKDEV $DEVDIR/bda b 14 # Ought to be
+# $MKSET 8 7 $MKDEV $DEVDIR/bdb b 14 # Ought to be
+# $MKSET 16 7 $MKDEV $DEVDIR/bdc b 14 # Ought to be
+# $MKSET 24 7 $MKDEV $DEVDIR/bdd b 14 # Ought to be
+
+##############################################################################
+# Joysticks. These are not yet supported.
+
+# $MKDEV $DEVDIR/js c 15
+# $MKDEV $DEVDIR/djs c 15
+
+##############################################################################
+# Generic SCSI devices. These are not yet supported.
+
+# $MKSET 0 15 $MKDEV $DEVDIR/sg c 21
+
+##############################################################################
+# Direct IDE disks, Secondary channel. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/hdc b 22
+# $MKSET 8 7 $MKDEV $DEVDIR/hdd b 22
+
+##############################################################################
+# Direct IDE disks, Tertiary channel. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/hde b 33
+# $MKSET 8 7 $MKDEV $DEVDIR/hdf b 33
+
+##############################################################################
+# Z80-SIO devices. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/scc c 34
+
+##############################################################################
+# Direct IDE disks, Quaternary channel. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/hde b 34
+# $MKSET 8 7 $MKDEV $DEVDIR/hdf b 34
+
+##############################################################################
+# Direct IDE disks, Quinternary channel. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/hdg b 56
+# $MKSET 8 7 $MKDEV $DEVDIR/hdh b 56
+
+##############################################################################
+# Direct IDE disks, Septernary channel. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/hdi b 57
+# $MKSET 8 7 $MKDEV $DEVDIR/hdj b 57
+
+##############################################################################
+# SCSI Media Changer. These are not yet supported.
+
+# $MKSET 0 15 $MKDEV $DEVDIR/sch c 86
+
+##############################################################################
+# I2C bus drivers. These are not yet supported.
+
+# $MKSET 0 7 $MKDEV $DEVDIR/i2c c 89
+
+##############################################################################
+# Conrad Electronic Parallel Port Radio Clocks. These are not yet supported.
+
+# $MKSET 0 1 $MKDEV $DEVDIR/pcfclock c 181
+
+##############################################################################
+# EOF.
diff -ruN ./elks-stuff/elkscmd/MAKESET ./elks/elkscmd/MAKESET
--- ./elks-stuff/elkscmd/MAKESET 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/MAKESET 2004-04-18 14:54:13.000000000 -0400
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+if [ $# -lt 6 -o $# -gt 7 ]; then
+ echo
+ echo "Usage: makeset min count cmd prefix type major [suffix]"
+ echo
+ echo "where min is the minor of the first node to make,"
+ echo " count is the number of the last node to make,"
+ echo " cmd is the command to make a node,"
+ echo " prefix is the node name prefix,"
+ echo " type is the type selector for the node,"
+ echo " major is the major number for the node,"
+ echo " and suffix is a suffix to append to the node names."
+ echo
+ echo "The following type selectors are supported:"
+ echo
+ echo " b Block device, all nodes have numeric suffix."
+ echo " d Block device, first node is raw device without numeric suffix."
+ echo
+ echo " c Character device with decimal numeric suffix."
+ echo " x Character device with hexadecimal numeric suffix."
+ echo
+else
+ N=0
+ while [ $N -le $2 ]; do
+ P=`expr $N + $1`
+ case ".$5" in
+ .b) eval $3 $4$N$7 $5 $6 $P
+ ;;
+ .c) eval $3 $4$N$7 $5 $6 $P
+ ;;
+ .d) if [ $N -gt 0 ]; then
+ eval $3 $4$N$7 $5 $6 $P
+ else
+ eval $3 $4$7 $5 $6 $P
+ fi
+ ;;
+ .x) if [ $N -gt 9 ]; then
+ R=`echo 123456789abcdef | cut -b $N`
+ eval $3 $4$R$7 c $6 $P
+ else
+ eval $3 $4$N$7 c $6 $P
+ fi
+ ;;
+ esac
+ N=`expr $N + 1`
+ done
+fi
diff -ruN ./elks-stuff/elkscmd/Make.defs ./elks/elkscmd/Make.defs
--- ./elks-stuff/elkscmd/Make.defs 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/Make.defs 2004-04-18 15:02:51.000000000 -0400
@@ -147,7 +147,7 @@
MKFS=/sbin/mkfs.minix
MKFS_OPTS=-n14

-MINIX_BOOT=$(DEV86_DIR)/bootblocks
+MINIX_BOOT=./bootblocks

##############################################################################
#
@@ -159,7 +159,7 @@
endif

ifeq ($(TARGET_MODE),LOOP)
-TARGET_MNT=/mnt/elks
+TARGET_MNT=/mnt/test
LOOP=-o loop
endif

diff -ruN ./elks-stuff/elkscmd/Makefile ./elks/elkscmd/Makefile
--- ./elks-stuff/elkscmd/Makefile 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/Makefile 2004-05-28 15:30:59.000000000 -0400
@@ -46,9 +46,10 @@
$(FULL3_TARGET_FS) $(FULL5_TARGET_FS) || true
rm -f $(COMB_TARGET_FS) $(ROOT_TARGET_FS) $(ROOT_NET_TARGET_FS) \
$(FULL3_TARGET_FS) $(FULL5_TARGET_FS) boot images.zip core
- rm -rf rootfs_template $(ROOTDIR)
+ rm -rf ./rootfs_template $(ROOTDIR)
+ rm -rf ./bootblocks/*s ./bootblocks/*bin ./bootblocks/*v
@for i in $(DIRS); do make -C $$i clean ; done
- tar xf rootfs_template.tar
+ tar xzf rootfs_template.tar.gz

###############################################################################
#
@@ -119,10 +120,13 @@
# Create relevant parts of other packages.

$(FD_BSECT):
- make -C $(MINIX_BOOT) bin
+ bcc -Mf -O -DTRY_FLOPPY -DDOTS -o ./bootblocks/minix.s -S ./bootblocks/minix.c
+ as86 -w- -0 -b ./bootblocks/minix.bin -s ./bootblocks/minix.sym ./bootblocks/minix.s

$(KHELPER):
- make -C $(MINIX_BOOT)
+ as86_encap ./bootblocks/minix.s ./bootblocks/minix.v minix_ -0 -w
+ bcc -Mf -O -DDOTS -o ./bootblocks/minix_elks.s -S ./bootblocks/minix_elks.c
+ as86 -w- -0 -b ./bootblocks/minix_elks.bin -s ./bootblocks/minix_elks.sym ./bootblocks/minix_elks.s

###############################################################################
#
@@ -146,8 +150,8 @@
$(SIBO_TARGET_FS):
dd if=/dev/zero of=$(SIBO_TARGET_FS) bs=1024 count=$(SIBO_TARGET_BLKS)

-$(ELKSCMD_DIR)/rootfs_template/etc/passwd: rootfs_template.tar
- tar xpf rootfs_template.tar
+$(ELKSCMD_DIR)/rootfs_template/etc/passwd: rootfs_template.tar.gz
+ tar xzpf rootfs_template.tar.gz

$(ELKSCMD_DIR)/rootfs_template/etc/issue: $(ELKSCMD_DIR)/rootfs_template/etc/passwd $(ELKS_DIR)/Makefile
$(ELKSCMD_DIR)/tools/ver.pl $(ELKS_DIR)/Makefile > $(ELKSCMD_DIR)/rootfs_template/etc/issue
@@ -155,37 +159,37 @@
mount_combfs: $(COMB_TARGET_FS) $(ELKSCMD_DIR)/rootfs_template/etc/issue
$(MKFS) $(MKFS_OPTS) $(COMB_TARGET_FS) $(COMB_TARGET_BLKS)
mount $(COMB_TARGET_FS) $(TARGET_MNT) $(LOOP)
- (cd $(ELKSCMD_DIR)/rootfs_template ; tar cf - --exclude CVS *) | \
- (cd $(TARGET_MNT) ; tar xpvf -)
- (cd $(TARGET_MNT)/dev ; ./MAKEDEV)
+ cd $(ELKSCMD_DIR)/rootfs_template; tar cf test.tar ./; cp ./test.tar $(TARGET_MNT)
+ cd $(TARGET_MNT); tar -xpf ./test.tar; rm -rf test.tar; cd $(ELKSCMD_DIR)
+ rm -rf ./rootfs_template/test.tar; ./MAKEDEV

mount_full3fs: $(FULL3_TARGET_FS) $(ELKSCMD_DIR)/rootfs_template/etc/issue
$(MKFS) $(MKFS_OPTS) $(FULL3_TARGET_FS) $(FULL3_TARGET_BLKS)
mount $(FULL3_TARGET_FS) $(TARGET_MNT) $(LOOP)
- (cd $(ELKSCMD_DIR)/rootfs_template ; tar cf - --exclude CVS *) | \
- (cd $(TARGET_MNT) ; tar xpvf -)
- (cd $(TARGET_MNT)/dev ; ./MAKEDEV)
+ cd $(ELKSCMD_DIR)/rootfs_template; tar cf test.tar ./; cp ./test.tar $(TARGET_MNT)
+ cd $(TARGET_MNT); tar -xpf ./test.tar; rm -rf test.tar; cd $(ELKSCMD_DIR)
+ rm -rf ./rootfs_template/test.tar; ./MAKEDEV

mount_full5fs: $(FULL5_TARGET_FS) $(ELKSCMD_DIR)/rootfs_template/etc/issue
$(MKFS) $(MKFS_OPTS) $(FULL5_TARGET_FS) $(FULL5_TARGET_BLKS)
mount $(FULL5_TARGET_FS) $(TARGET_MNT) $(LOOP)
- (cd $(ELKSCMD_DIR)/rootfs_template ; tar cf - --exclude CVS *) | \
- (cd $(TARGET_MNT) ; tar xpvf -)
- (cd $(TARGET_MNT)/dev ; ./MAKEDEV)
+ cd $(ELKSCMD_DIR)/rootfs_template; tar cf test.tar ./; cp ./test.tar $(TARGET_MNT)
+ cd $(TARGET_MNT); tar -xpf ./test.tar; rm -rf test.tar; cd $(ELKSCMD_DIR)
+ rm -rf ./rootfs_template/test.tar; ./MAKEDEV

mount_rootfs: $(ROOT_TARGET_FS) $(ELKSCMD_DIR)/rootfs_template/etc/issue
- $(MKFS) $(MKFS_OPTS) $(ROOT_TARGET_FS) $(ROOT_TARGET_BLKS)
+ $(MKFS) -i 200 $(MKFS_OPTS) $(ROOT_TARGET_FS) $(ROOT_TARGET_BLKS)
mount $(ROOT_TARGET_FS) $(TARGET_MNT) $(LOOP)
- (cd $(ELKSCMD_DIR)/rootfs_template ; tar cf - --exclude CVS *) | \
- (cd $(TARGET_MNT) ; tar xpvf -)
- (cd $(TARGET_MNT)/dev ; ./MAKEDEV)
+ cd $(ELKSCMD_DIR)/rootfs_template; tar cf test.tar ./; cp ./test.tar $(TARGET_MNT)
+ cd $(TARGET_MNT); tar -xpf ./test.tar; rm -rf test.tar; cd $(ELKSCMD_DIR)
+ rm -rf ./rootfs_template/test.tar; ./MAKEDEV

mount_rootnetfs: $(ROOT_NET_TARGET_FS) $(ELKSCMD_DIR)/rootfs_template/etc/issue
$(MKFS) $(MKFS_OPTS) $(ROOT_NET_TARGET_FS) $(ROOT_NET_TARGET_BLKS)
mount $(ROOT_NET_TARGET_FS) $(TARGET_MNT) $(LOOP)
- (cd $(ELKSCMD_DIR)/rootfs_template ; tar cf - --exclude CVS *) | \
- (cd $(TARGET_MNT) ; tar xpvf -)
- (cd $(TARGET_MNT)/dev ; ./MAKEDEV)
+ cd $(ELKSCMD_DIR)/rootfs_template; tar cf test.tar ./; cp ./test.tar $(TARGET_MNT)
+ cd $(TARGET_MNT); tar -xpf ./test.tar; rm -rf test.tar; cd $(ELKSCMD_DIR)
+ rm -rf ./rootfs_template/test.tar; ./MAKEDEV

mount_sibofs: $(SIBO_TARGET_FS) $(ELKSCMD_DIR)/rootfs_template/etc/issue
$(MKFS) $(MKFS_OPTS) $(SIBO_TARGET_FS) $(SIBO_TARGET_BLKS)
@@ -210,35 +214,42 @@

comb: mount_combfs $(ELKS_DIR)/arch/i86/boot/Image $(FD_BSECT) $(KHELPER)
+ dd if=/dev/zero of=./flagfile bs=1k count=0
@for i in $(DIRS); do make -C $$i min_rfs ; done
+ mkdir $(TARGET_MNT)/boot
cp $(ELKS_DIR)/arch/i86/boot/Image $(TARGET_MNT)/boot/linux
cp $(KHELPER) $(TARGET_MNT)/boot/boot
umount $(COMB_TARGET_FS)
dd if=$(FD_BSECT) of=$(COMB_TARGET_FS) bs=512 count=2 conv=notrunc

full3: mount_full3fs $(ELKS_DIR)/arch/i86/boot/Image $(FD_BSECT) $(KHELPER)
+ mkdir $(TARGET_MNT)/bin; cp -p -f $(ELKSNET_DIR)/ktcp/ktcp $(TARGET_MNT)/bin
@for i in $(DIRS); do make -C $$i rfs ; done
+ mkdir $(TARGET_MNT)/boot
cp $(ELKS_DIR)/arch/i86/boot/Image $(TARGET_MNT)/boot/linux
cp $(KHELPER) $(TARGET_MNT)/boot/boot
umount $(FULL3_TARGET_FS)
dd if=$(FD_BSECT) of=$(FULL3_TARGET_FS) bs=512 count=2 conv=notrunc

-full5: mount_full3fs $(ELKS_DIR)/arch/i86/boot/Image $(FD_BSECT) $(KHELPER)
+full5: mount_full5fs $(ELKS_DIR)/arch/i86/boot/Image $(FD_BSECT) $(KHELPER)
@for i in $(DIRS); do make -C $$i rfs ; done
+ mkdir $(TARGET_MNT)/boot
cp $(ELKS_DIR)/arch/i86/boot/Image $(TARGET_MNT)/boot/linux
cp $(KHELPER) $(TARGET_MNT)/boot/boot
- umount $(FULL3_TARGET_FS)
- dd if=$(FD_BSECT) of=$(FULL3_TARGET_FS) bs=512 count=2 conv=notrunc
+ umount $(FULL5_TARGET_FS)
+ dd if=$(FD_BSECT) of=$(FULL5_TARGET_FS) bs=512 count=2 conv=notrunc

root: mount_rootfs
+ rm -rf ./flagfile
@for i in $(DIRS); do make -C $$i min_rfs ; done
umount $(ROOT_TARGET_FS)

comb_net: mount_rootnetfs $(ELKS_DIR)/arch/i86/boot/Image $(FD_BSECT) $(KHELPER)
cd $(ELKSNET_DIR)/ktcp ; \
make ; \
- cp -p -f ktcp $(TARGET_MNT)/bin
+ mkdir $(TARGET_MNT)/bin; cp -p -f ktcp $(TARGET_MNT)/bin
@for i in $(DIRS); do make -C $$i net_rfs ; done
+ mkdir $(TARGET_MNT)/boot
cp $(ELKS_DIR)/arch/i86/boot/Image $(TARGET_MNT)/boot/linux
cp $(KHELPER) $(TARGET_MNT)/boot/boot
umount $(ROOT_NET_TARGET_FS)
diff -ruN ./elks-stuff/elkscmd/ash/Makefile ./elks/elkscmd/ash/Makefile
--- ./elks-stuff/elkscmd/ash/Makefile 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/ash/Makefile 2004-04-21 17:14:03.000000000 -0400
@@ -1,6 +1,6 @@
# Makefile for ash.
#
-# 19980209 Claudio Matsuoka <claudio@conectiva.com>
+# 19980209 Claudio Matsuoka <claudio@pos.inf.ufpr.br>
# Modified for ELKS and bcc

BASEDIR=..
@@ -70,13 +70,13 @@

rfs: install

-min_rfs: install
+min_rfs:

net_rfs: install

smin_rfs:

-install: ash
+install: ash
cp -p ash $(TARGET_MNT)/bin/ash
rm -f $(TARGET_MNT)/bin/sh
ln $(TARGET_MNT)/bin/ash $(TARGET_MNT)/bin/sh
diff -ruN ./elks-stuff/elkscmd/ash/README.elks ./elks/elkscmd/ash/README.elks
--- ./elks-stuff/elkscmd/ash/README.elks 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/ash/README.elks 1999-02-16 13:22:59.000000000 -0500
@@ -13,7 +13,7 @@
Change log:

--------------------------------------------------------------
-19980209 Claudio Matsuoka <claudio@conectiva.com>
+19980209 Claudio Matsuoka <claudio@pos.inf.ufpr.br>

(*) Initial port (quite trivial).
Adjusted makefiles for bcc, defined sig_t as int, kicked out some
@@ -59,7 +59,7 @@
Very important for some powerful but easy to use IPC.

--------------------------------------------------------------
-19980218 Claudio Matsuoka <claudio@conectiva.com>
+19980218 Claudio Matsuoka <claudio@pos.inf.ufpr.br>

(*) Workaround for bcc miscompilation in bltin/expr.c.
bcc complained about "invalid indirect to indirect" and "invalid label"
diff -ruN ./elks-stuff/elkscmd/ash/bltin/expr.c ./elks/elkscmd/ash/bltin/expr.c
--- ./elks-stuff/elkscmd/ash/bltin/expr.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/ash/bltin/expr.c 1999-02-16 13:22:59.000000000 -0500
@@ -173,7 +173,7 @@
binary = opsp->op;
for (;;) {
/*
- * 19980218 Claudio Matsuoka <claudio@conectiva.com>
+ * 19980218 Claudio Matsuoka <claudio@pos.inf.ufpr.br>
* Oh my, this is a nasty one! Once again, bcc
* complains about invalid indirect to indirect
* (mov byte ptr -9[bp],#_op_argflag[bx]).
@@ -280,7 +280,7 @@
*/

/*
- * 19980218 Claudio Matsuoka <claudio@conectiva.com>
+ * 19980218 Claudio Matsuoka <claudio@pos.inf.ufpr.br>
* So, here's one more workaround for a bcc problem. This time bcc
* complains about an illegal label when using `goto filetype'.
*/
diff -ruN ./elks-stuff/elkscmd/ash/bltin/regexp.c ./elks/elkscmd/ash/bltin/regexp.c
--- ./elks-stuff/elkscmd/ash/bltin/regexp.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/ash/bltin/regexp.c 1999-02-16 13:22:59.000000000 -0500
@@ -260,7 +260,7 @@
break;
case RE_MATCHED:
/*
- * 19980218 Claudio Matsuoka <claudio@conectiva.com>
+ * 19980218 Claudio Matsuoka <claudio@pos.inf.ufpr.br>
* Workaround for bcc compilation problem
*/

@@ -310,7 +310,7 @@
len = 1;
if (*curpat == RE_MATCHED) {
/*
- * 19980218 Claudio Matsuoka <claudio@conectiva.com>
+ * 19980218 Claudio Matsuoka <claudio@pos.inf.ufpr.br>
* Yet another workaround for a bcc problem.
*/
#if 0
diff -ruN ./elks-stuff/elkscmd/ash/expand.c ./elks/elkscmd/ash/expand.c
--- ./elks-stuff/elkscmd/ash/expand.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/ash/expand.c 1999-02-16 13:22:59.000000000 -0500
@@ -491,7 +491,7 @@
break;
#if 0
/*
- * 19980209 Claudio Matsuoka <claudio@conectiva.com>
+ * 19980209 Claudio Matsuoka <claudio@pos.inf.ufpr.br>
* FIXME: Commented out due to problems with bcc (illegal
* indirect to indirect: mov byte ptr -1[si],#_optchar[bx]).
*/
diff -ruN ./elks-stuff/elkscmd/ash/parser.c ./elks/elkscmd/ash/parser.c
--- ./elks-stuff/elkscmd/ash/parser.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/ash/parser.c 2002-01-13 19:19:04.000000000 -0500
@@ -692,7 +692,7 @@
*/

/*
- * 19980209 Claudio Matsuoka <claudio@conectiva.com>
+ * 19980209 Claudio Matsuoka <claudio@pos.inf.ufpr.br>
* bcc fails with `return lasttoken = token', returning an invalid value.
*/
#define RETURN(token) { lasttoken = token; return token; }
diff -ruN ./elks-stuff/elkscmd/bc/Makefile ./elks/elkscmd/bc/Makefile
--- ./elks-stuff/elkscmd/bc/Makefile 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/bc/Makefile 2004-04-21 17:43:20.000000000 -0400
@@ -90,7 +90,7 @@
install -c -o bin $? $@

rfs: all
- cp -p bc $(TARGET_MNT)/bin
+ cp -p fbc $(TARGET_MNT)/bin

min_rfs: all

diff -ruN ./elks-stuff/elkscmd/bootblocks/minix.c ./elks/elkscmd/bootblocks/minix.c
--- ./elks-stuff/elkscmd/bootblocks/minix.c 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/bootblocks/minix.c 2004-04-18 15:00:49.000000000 -0400
@@ -0,0 +1,943 @@
+/*
+ * This bootblock loads the linux-8086 executable in the file 'boot'
+ * from the root directory of a minix filesystem.
+ *
+ * Copyright (C) 1990-1998 Robert de Bath, distributed under the GPL Version 2
+ * Based on minix filesystem definitions.
+ *
+ * TODO:
+ * Alter nogood() to do a mov sp,... so the helper program can override
+ * the panic message.
+ */
+
+#include <a.out.h>
+#include "minix.h"
+
+/* #define DOTS /* define to have dots printed */
+/* #define HARDDISK /* Define for hard disk version */
+/* #define TRY_FLOPPY /* To do trial reads to find floppy size */
+
+/* #define MIN_SPACE */
+
+#define zone_shift 0 /* for any < 32M (!= 0 not supported yet, if ever) */
+#define seg_at(k) ((k)*64)
+#define seg_of(p) ((unsigned int)p >>4)
+#define BOOTSEG (0x07c0)
+#define LOADSEG (0x1000)
+#define ORGADDR (0x0500)
+
+#ifdef HARDDISK
+#define get_now()
+#endif
+
+#ifdef zone_shift
+#if zone_shift == 0
+#define load_zone load_block
+#endif
+#else
+static short zone_shift;
+#endif
+
+#asm
+BOOTADDR = 0x7c00
+
+.text
+! Apparently on startup the only things we can assume are that we start at
+! `start` (ABS addr $07C00) and the boot sector is in the segment.
+
+! So first set CS=DS=ES=SS=0
+! The we move this to $0500 and put the stack at the top of the first 64k.
+! The directory 'file' is loaded $1500 and scanned there.
+! The final executable will be loaded in the 2nd 64k chunk.
+!
+org ORGADDR ! The lowest available address.
+start:
+#ifndef MIN_SPACE
+ include sysboot.s
+
+org start ! The lowest available address, again.
+ j skip_vars
+
+org dos_sysid
+ .ascii "MINIXFS BOOT (C) 1990-1999, Robert de Bath"
+
+ org codestart
+#endif
+
+! A few variables we need to know the positions of for patching, so export
+! them and as86_encaps will make some variables. Put them here at the start
+! so they're in the same place for both Floppy and harddisk versions as they
+! will be used by helper programs.
+
+export inode ! Inode to search
+inode:
+_inode: .word 1 ! ROOT_INODE
+
+#ifndef MIN_SPACE
+export dinode ! Inode of directory file was found in.
+dinode:
+_dinode: .word 1 ! ROOT_INODE
+#endif
+
+export bootfile ! File to boot, make this whatever you like,
+bootfile: ! 'boot' is good, 'linux' too.
+_bootfile:
+ .ascii "boot"
+ .byte 0,0,0,0,0,0,0,0,0,0
+
+skip_vars:
+#ifdef HARDDISK
+ mov bx,[si+8] ! Fetch the linear address of part from DS:SI
+ mov dh,[si+10] ! DL is drive number
+#endif
+
+ xor ax,ax ! All segments are zero, first 64k of mem.
+ mov ds,ax
+ mov es,ax
+ mov ss,ax
+ mov sp,ax
+
+#ifndef HARDDISK
+loopy:
+ mov ax,#$0203 ! Read 3 sectors, code + superblock.
+ mov bx,#start ! Where this _should_ be
+ mov cx,#$0001 ! From sector 1
+ xor dx,dx ! Of the floppy drive head zero
+ int $13
+ jc loopy
+#else
+
+ mov cx,#$100 ! Move 256 words
+ mov si,#BOOTADDR ! From default BB
+ mov di,#ORGADDR ! To the correct address.
+ rep
+ movsw
+
+ xchg dl,dh
+ mov [bootpart],bx ! Save the partition sector offset (and drive)
+ mov [bootpart+2],dx
+
+ ! Read next 2 sectors of hd.
+ xor dx,dx
+ mov cx,#1
+ mov bx,#ORGADDR+$200
+ mov al,#2
+
+ call load_sect
+#endif
+
+ jmpi code,#0
+
+#endasm
+
+/* \f/* */
+/****************************************************************************/
+/* Section cdef */
+/****************************************************************************/
+
+/* The name of the file and inode to start */
+extern char bootfile[];
+extern inode_nr inode;
+extern inode_nr dinode;
+
+/* For multi-sector reads */
+extern sect_nr lastsect;
+extern sect_nr firstsect;
+extern unsigned loadaddr;
+extern unsigned loadcount;
+
+/* Keep track of zones to load */
+extern zone_nr * next_zone;
+extern zone_nr * end_zone;
+extern zone_nr indirect;
+
+/* Where to load zones */
+extern unsigned ldaddr;
+
+/* Directory reading */
+extern dir_struct * dirptr;
+extern unsigned flength;
+extern unsigned dir_32;
+
+#ifndef HARDDISK
+/* The 'shape' of the floppy - intuit from superblock or try to read max */
+extern unsigned n_sectors;
+#endif
+
+extern struct super_block b_super;
+extern d_inode b_inode[INODES_PER_BLOCK];
+extern zone_nr b_zone[NR_INDIRECTS];
+extern dir_struct directory[];
+
+/* \f/* */
+/****************************************************************************/
+/* Section adef */
+/****************************************************************************/
+
+#asm
+.text
+
+#ifdef HARDDISK
+bootpart: .long 0
+#else
+_loadcount: .word 0
+_firstsect: .word 0
+_loadaddr: .word 0
+_lastsect: .word 0
+#endif
+
+ block start+0x400
+_b_super: .blkb 512
+
+#ifndef MIN_SPACE
+export helper
+helper: .blkb 1024
+export helper_end
+helper_end:
+#endif
+
+_b_inode: .blkb 1024
+_b_zone: .blkb 1024
+
+#ifdef MIN_SPACE
+temp_space: .blkb 512
+#endif
+probe_buf:
+_directory: .blkb 32768
+ endb
+
+#endasm
+
+/* \f/* */
+/****************************************************************************/
+/* Section nogood */
+/****************************************************************************/
+/* #if defined(HARDDISK) && !defined(SKIPBOOT) */
+#ifndef SKIPBOOT
+static
+nogood()
+{
+#asm
+ mov si,#fail_fs
+min_nextc:
+ lodsb
+ cmp al,#0
+ jz min_eos
+ mov bx,#7
+ mov ah,#$E ! Can't use $13 cause that's AT+ only!
+ int $10
+ jmp min_nextc
+min_eos: ! Wait for a key then reboot
+ xor ax,ax
+ int $16
+ jmpi $0,$FFFF ! Reboot.
+
+fail_fs:
+ .byte 13,10
+#if defined(HARDDISK)
+ .asciz "Initial boot failed, press return to reboot\r\n"
+#else
+ .asciz "Boot failed:"
+#endif
+#endasm
+}
+
+#else
+
+static
+nogood()
+{
+/* This didn't work, chain the boot sector of the HD */
+#asm
+ push cs
+ pop es
+hcode:
+ mov ax,#$0201 ! Read 1 sector
+ mov bx,#BOOTADDR ! In the boot area
+ mov cx,#$0001 ! From sector 1
+ mov dx,#$0080 ! Of the hard drive head zero
+ int $13
+ jc hcode ! Keep trying forever!
+ jmpi BOOTADDR,0
+#endasm
+}
+#endif
+
+/* \f/* */
+/****************************************************************************/
+/* Section hd_sect */
+/****************************************************************************/
+#ifdef HARDDISK
+#asm
+!
+! Load AL sectors from linear sector DX:CX into location ES:BX
+! Linear sector zero is at [bootpart]
+! This loads one sector at a time, but that's OK cause even in the _very_
+! worst case it'll take no more that 5 seconds to load a 16 bit executable.
+!
+load_sect:
+ add cx,[bootpart]
+ adc dx,[bootpart+2]
+moresect:
+ cmp al,#0
+ jnz onesect
+ clc
+ ret
+
+! Load one sector...
+onesect:
+ push ax ! Save lots
+ push di
+ push si
+ push cx ! Drive and sector.
+ push dx
+
+ push es ! Load location
+ push bx
+
+ push cx ! Drive and sector again.
+ push dx
+
+ ! Fetch drive 'shape'
+ mov ah,#8
+ mov dl,dh
+ int $13 ! DX:CX = drive specification
+ jc _nogood
+
+ and cx,#$3F ! Get sector count => DI
+ mov di,cx
+
+ xor dl,dl ! Get head count => SI
+ xchg dl,dh
+ inc dx
+ mov si,dx
+
+ pop dx ! Get back drive and sector
+ pop ax
+
+ mov bl,dh ! Save drive
+ xor dh,dh
+
+ div di ! DX=sector, AX=track number
+ mov cx,dx
+ inc cl ! CL=sector number
+
+ xor dx,dx
+ div si ! DX=head, AX=cylinder
+
+ mov dh,dl
+ mov dl,bl ! DX for int 1302
+
+ xchg al,ah
+ ror al,#1
+ ror al,#1
+ or cx,ax ! CX for int 1302
+
+ pop bx ! ES:BX for int 1302
+ pop es
+
+ mov di,#5 ! Lots of retries for a hd
+retry:
+ mov ax,#$0201
+ int $13
+ jnc got_hd_sect
+
+ xor ax,ax ! Reset between each try.
+ int $13
+
+ dec di
+ jnz retry
+ br _nogood
+
+got_hd_sect:
+ pop dx
+ pop cx
+ pop si
+ pop di
+ pop ax
+
+ dec al
+ add cx,#1
+ adc dh,#0
+ add bh,#2
+ jmp moresect
+#endasm
+#endif
+
+/****************************************************************************/
+/* This is the end of the parts that MUST be in the first sector */
+/* From here down the functions can safely be in any order. */
+/****************************************************************************/
+
+/* \f/* */
+/****************************************************************************/
+/* Section fd_block */
+/****************************************************************************/
+#ifndef HARDDISK
+static
+load_block(address, blkno)
+unsigned address, blkno;
+{
+ register sect_nr sectno;
+ if(blkno == 0) { zero_block(address); return; }
+#ifdef DOTS
+ prt_dot();
+#endif
+
+ sectno = (sect_nr)blkno * 2;
+ load_sect(address, sectno);
+ load_sect(address+32, sectno+1);
+}
+#endif
+
+/****************************************************************************/
+/* Section fd_bpb */
+/****************************************************************************/
+#ifndef HARDDISK
+#asm
+_set_bpb:
+#ifdef MIN_SPACE
+bios_tabl=temp_space ! Temp space.
+bios_disk=temp_space+4 !
+#else
+bios_tabl=dosfs_stat ! Temp space.
+bios_disk=dosfs_stat+4 !
+#endif
+
+#ifndef __CALLER_SAVES__
+ push si
+ push di
+#endif
+
+ mov di,#bios_disk
+ mov bx,#0x78
+! 0:bx is parameter table address
+
+ push ds
+ push di
+
+ mov si,[bx]
+ mov ax,[bx+2]
+ mov [bios_tabl],si
+ mov [bios_tabl+2],ax
+ push ax
+
+ pop ds
+! ds:si is source
+
+! copy 12 bytes
+ mov cl,#6
+ cld
+ rep
+ movsw
+
+ pop di
+ pop ds
+ mov ax,[_n_sectors]
+ movb 4[di],al ! patch sector count
+
+ mov [bx],di
+ mov 2[bx],es
+
+#ifndef __CALLER_SAVES__
+ pop si
+ pop di
+#endif
+ ret
+
+_unset_bpb:
+! 0:0x78 is parameter table address
+
+ mov ax,[bios_tabl]
+ mov [0x78],ax
+ mov ax,[bios_tabl+2]
+ mov [0x78+2],ax
+ ret
+
+#endasm
+#endif
+
+/****************************************************************************/
+/* Section fd_get_now */
+/****************************************************************************/
+#ifndef HARDDISK
+static
+get_now()
+{
+#asm
+ mov si,#5
+retry_get:
+ xor dx,dx
+ mov cx,[_firstsect]
+ shr ch,#1
+ adc dh,#0
+ mov es,[_loadaddr]
+ xor bx,bx
+ mov ax,[_loadcount]
+ test ax,ax
+ jz no_load
+ mov ah,#2
+ int $13 ! Try fetch
+ jnc no_load
+ xor ax,ax ! Bad, retry.
+ int $13
+ dec si
+ jnz retry_get
+ br _nogood
+no_load:
+ xor ax,ax
+ mov [_loadcount],ax
+#endasm
+}
+#endif
+
+/****************************************************************************/
+/* Section fd_probe */
+/****************************************************************************/
+#ifndef HARDDISK
+#ifdef TRY_FLOPPY
+#asm
+!-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+!
+! These are the number of sectors per track that will be scanned for.
+! For 3.5 inch floppies 36 is 2.88 Mb, 18 is 1.44Mb, 21 is 1.68Mb on
+! a 1.44Mb floppy drive. 15 and 9 are for 5.25 inch floppies.
+
+disksizes: .byte 36,21,18,15,9
+
+! It seems that there is no BIOS call to get the number of sectors. Guess
+! 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read,
+! 15 if sector 15 can be read. Otherwise guess 9.
+
+_probe_sectors:
+ mov si,#disksizes ! table of sizes to try
+
+probe_loop:
+ lodsb
+ cbw ! extend to word
+ mov _n_sectors, ax
+ cmp al,#9
+ je got_sectors ! if all else fails, try 9
+ xchg ax, cx ! cx = track and sector
+ xor dx, dx ! drive 0, head 0
+ mov bx,#probe_buf ! address after setup (es = cs)
+ mov ax,#0x0201 ! service 2, 1 sector
+ int 0x13
+ jc probe_loop ! try next value
+got_sectors:
+
+ ret
+#endasm
+#else
+probe_sectors()
+{
+ /* Guess the number of sectors based on the size of the file system */
+ if( (n_sectors = b_super.s_nzones / 40) > 11 ) n_sectors /= 2;
+}
+#endif
+#endif
+
+/****************************************************************************/
+/* Section fd_sect */
+/****************************************************************************/
+#ifndef HARDDISK
+static
+load_sect(address, sectno)
+unsigned address;
+sect_nr sectno;
+{
+ register sect_nr nsect;
+
+ nsect = sectno%n_sectors +1;
+ sectno /= n_sectors;
+ nsect |= (sectno<<8);
+
+ if( loadcount )
+ {
+ lastsect++;
+ if( ( address & 4095 ) && nsect == lastsect )
+ {
+ loadcount++;
+ return;
+ }
+ get_now();
+ }
+
+ lastsect = firstsect = nsect;
+ loadaddr = address;
+ loadcount = 1;
+}
+#endif
+
+/****************************************************************************/
+/* Section fd_zeroblk */
+/****************************************************************************/
+#ifndef HARDDISK
+static
+zero_block(address)
+{
+#asm
+#if __FIRST_ARG_IN_AX__
+ mov es,ax
+#else
+ mov bx,sp
+ mov es,[bx+2]
+#endif
+ push di
+ mov cx,#512
+ xor ax,ax
+ mov di,ax
+ rep
+ stosw
+ pop di
+#endasm
+}
+#endif
+
+/****************************************************************************/
+/* Section hd_block */
+/****************************************************************************/
+#ifdef HARDDISK
+/*----------------------------------*/
+/* Hard disk block driver */
+/*----------------------------------*/
+
+#asm
+_load_block:
+ push bp
+ mov bp,sp
+#if __FIRST_ARG_IN_AX__
+ ! Fetch load location
+ mov es,ax
+
+ ! Test for block zero
+ mov ax,4[bp]
+#else
+ ! Fetch load location
+ mov ax,[bp+4]
+ mov es,ax
+
+ ! Test for block zero
+ mov ax,6[bp]
+#endif
+ test ax,ax
+ jne real_block
+
+ ! Iff block zero, zap memory
+ push di
+ mov cx,#512
+ xor ax,ax
+ mov di,ax
+ rep
+ stosw
+ pop di
+
+func_exit:
+ mov sp,bp
+ pop bp
+ ret
+
+real_block:
+#ifdef DOTS
+ push ax
+ call _prt_dot
+ pop ax
+#endif
+
+! Load a real block.
+ mov cx,ax
+ xor dx,dx
+ shl cx,#1
+ rcl dx,#1
+
+ xor bx,bx
+ mov al,#2
+ call load_sect
+
+ j func_exit
+#endasm
+#endif
+
+/****************************************************************************/
+/* Section main */
+/****************************************************************************/
+#asm
+code:
+ call _loadprog
+ call _runprog
+ br _nogood
+
+#endasm
+
+/****************************************************************************/
+/* Section prt_dots */
+/****************************************************************************/
+#ifdef DOTS
+#asm
+_prt_crlf:
+ mov al,#13
+ call outch
+ mov al,#10
+ j outch
+_prt_dot:
+ mov al,#'.
+outch:
+ mov ah,#$0E
+ mov bx,#7
+ int $10
+ ret
+#endasm
+#endif
+
+/****************************************************************************/
+/* Section end_1 */
+/****************************************************************************/
+#if defined(HARDDISK) || !defined(MIN_SPACE)
+#asm
+end_of_part1:
+#ifdef HARDDISK
+ if *>start+0x1FE ! Leave space for magic
+#else
+ if *>start+0x200
+#endif
+ fail! Part 1 too large!
+ endif
+ .blkb 0x200+start-*
+#endasm
+#endif
+
+/****************************************************************************/
+/* Section prog_load */
+/****************************************************************************/
+
+loadprog()
+{
+#ifdef DOTS
+ prt_dot();
+#endif
+ if( b_super.s_magic == SUPER_MAGIC2 )
+ dir_32 = 1;
+ else if( b_super.s_magic == SUPER_MAGIC )
+ dir_32 = 0;
+ else
+ nogood();
+
+#ifdef zone_shift
+ if( zone_shift != b_super.s_log_zone_size) nogood();
+#else
+ zone_shift = b_super.s_log_zone_size;
+#endif
+
+#ifndef HARDDISK
+ probe_sectors();
+
+ /* if( (n_sectors = b_super.s_nzones / 40) > 11 ) n_sectors /= 2; */
+
+ set_bpb();
+#endif
+
+try_again:;
+ inode--;
+ load_block(seg_of(b_inode), inode/INODES_PER_BLOCK
+ + b_super.s_imap_blocks
+ + b_super.s_zmap_blocks
+ + 2);
+ get_now();
+
+ ldaddr = LOADSEG; /* Load at 64k mark */
+
+ {
+ register d_inode * i_ptr;
+ i_ptr = b_inode + inode%INODES_PER_BLOCK;
+ next_zone = i_ptr->i_zone;
+ flength = i_ptr->i_size;
+ if( (i_ptr->i_mode & I_TYPE) == I_DIRECTORY )
+ {
+ ldaddr = seg_of(directory);
+#ifndef MIN_SPACE
+ dinode = inode+1; /* Remember current directory */
+#endif
+ inode = 0; /* Mark - we've no _file_ inode yet */
+ }
+ }
+
+ end_zone = next_zone+NR_DZONE_NUM;
+ load_zone(seg_of(b_zone), (indirect = next_zone[NR_DZONE_NUM]));
+ get_now();
+
+ for(;;)
+ {
+ if( next_zone >= end_zone )
+ {
+ if( indirect != 0 )
+ {
+ next_zone = b_zone;
+ end_zone = next_zone + NR_INDIRECTS;
+ indirect = 0;
+ continue;
+ }
+ break;
+ }
+ load_zone(ldaddr, *next_zone);
+ next_zone++;
+ ldaddr += (seg_at(1) << zone_shift);
+ }
+ get_now();
+
+#ifdef DOTS
+ prt_crlf();
+#endif
+ if(!inode)
+ {
+ dirptr = directory;
+ while(flength > 0)
+ {
+register char * s = bootfile;
+register char * p = dirptr->d_name;
+
+ if( dirptr->d_inum )
+ {
+ for(;;)
+ {
+ if( *s == '\0')
+ {
+ if(*p == '\0')
+ {
+ inode = dirptr->d_inum;
+ goto try_again;
+ }
+ break;
+ }
+ if( *s++ != *p++ ) break;
+ }
+ }
+ flength -= 16;
+ dirptr++;
+ if( dir_32 )
+ {
+ flength -= 16;
+ dirptr++;
+ }
+ }
+ nogood();
+ }
+#ifndef HARDDISK
+ unset_bpb();
+#endif
+}
+
+/****************************************************************************/
+/* Section prog_run */
+/****************************************************************************/
+static
+runprog()
+{
+/* It all worked, run the loaded executable */
+#asm
+#ifdef HARDDISK
+ mov dx,[bootpart+2]
+ xchg dh,dl ! DX => hard drive
+ push [bootpart] ! CX => partition offset
+ xor si,si
+#else
+ xor dx,dx ! DX=0 => floppy drive
+ push dx ! CX=0 => partition offset = 0
+ mov si,[_n_sectors] ! Save for monitor.out
+#endif
+
+ mov bx,#LOADSEG
+ mov ds,bx ! DS = loadaddress
+ xor di,di ! Zero
+ mov ax,[di]
+ cmp ax,#0x0301 ! Right magic ?
+ jnz binfile ! Yuk ... assume .SYS
+ inc bx
+ inc bx ! bx = initial CS
+ mov ax,[di+2]
+ and ax,#$20 ! Is it split I/D ?
+ jz impure ! No ...
+ mov cl,#4
+ mov ax,[di+8]
+ shr ax,cl
+impure:
+ pop cx
+ add ax,bx
+ mov ss,ax
+ mov sp,[di+24] ! Chmem value
+ mov ds,ax
+binfile:
+
+ push bx
+ push di ! jmpi 0,#LOADSEG+2
+ retf
+#endasm
+}
+
+/****************************************************************************/
+/* Section sys_libs */
+/****************************************************************************/
+#asm
+! These functions are pulled from the C library.
+libstuff:
+imodu:
+ xor dx,dx
+ div bx
+ mov ax,dx ! instruction queue full so xchg slower
+ ret
+idiv_u:
+ xor dx,dx
+ div bx
+ ret
+#ifndef zone_shift
+isl:
+islu:
+ mov cl,bl
+ shl ax,cl
+ ret
+#endif
+libend:
+#endasm
+
+/****************************************************************************/
+/* Section sys_vars */
+/****************************************************************************/
+#asm
+#ifdef MIN_SPACE
+ block temp_space+64
+#endif
+vars:
+#ifndef HARDDISK
+_n_sectors: .blkw 1
+#endif
+_next_zone: .blkw 1
+_end_zone: .blkw 1
+_indirect: .blkw 1
+_ldaddr: .blkw 1
+_dirptr: .blkw 1
+_flength: .blkw 1
+_dir_32: .blkw 1
+varend:
+#ifdef MIN_SPACE
+ endb
+#endif
+#endasm
+
+/****************************************************************************/
+/* Section end_2 */
+/****************************************************************************/
+#asm
+end_of_prog:
+ if *>start+0x400
+ fail! Part 2 too large!
+ endif
+
+ if end_of_prog<start+0x201
+ .blkb 0x400+start-*
+ else
+ .blkb 0x3FF+start-*
+ .byte 0xFF
+ endif
+
+#endasm
+
+/****************************************************************************/
diff -ruN ./elks-stuff/elkscmd/bootblocks/minix.h ./elks/elkscmd/bootblocks/minix.h
--- ./elks-stuff/elkscmd/bootblocks/minix.h 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/bootblocks/minix.h 2004-04-18 15:00:59.000000000 -0400
@@ -0,0 +1,104 @@
+/****************************************************************************/
+/* Super block table. The root file system and every mounted file system
+ * has an entry here. The entry holds information about the sizes of the bit
+ * maps and inodes. The s_ninodes field gives the number of inodes available
+ * for files and directories, including the root directory. Inode 0 is
+ * on the disk, but not used. Thus s_ninodes = 4 means that 5 bits will be
+ * used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
+ * for files and directories. The disk layout is:
+ *
+ * Item # blocks
+ * boot block 1
+ * super block 1
+ * inode map s_imap_blocks
+ * zone map s_zmap_blocks
+ * inodes (s_ninodes + 1 + INODES_PER_BLOCK - 1)/INODES_PER_BLOCK
+ * unused whatever is needed to fill out the current zone
+ * data zones (s_nzones - s_firstdatazone) << s_log_zone_size
+ *
+ * A super_block slot is free if s_dev == NO_DEV.
+ */
+
+#define BLOCK_SIZE 1024 /* # bytes in a disk block */
+
+/* Flag bits for i_mode in the inode. */
+#define I_TYPE 0170000 /* this field gives inode type */
+#define I_REGULAR 0100000 /* regular file, not dir or special */
+#define I_BLOCK_SPECIAL 0060000 /* block special file */
+#define I_DIRECTORY 0040000 /* file is a directory */
+#define I_CHAR_SPECIAL 0020000 /* character special file */
+#define I_SET_UID_BIT 0004000 /* set effective uid on exec */
+#define I_SET_GID_BIT 0002000 /* set effective gid on exec */
+#define ALL_MODES 0006777 /* all bits for user, group and others */
+#define RWX_MODES 0000777 /* mode bits for RWX only */
+#define R_BIT 0000004 /* Rwx protection bit */
+#define W_BIT 0000002 /* rWx protection bit */
+#define X_BIT 0000001 /* rwX protection bit */
+#define I_NOT_ALLOC 0000000 /* this inode is free */
+
+/* Type definitions */
+typedef unsigned short unshort; /* must be 16-bit unsigned */
+typedef unshort block_nr; /* block number */
+typedef unshort inode_nr; /* inode number */
+typedef unshort zone_nr; /* zone number */
+typedef unshort bit_nr; /* if inode_nr & zone_nr both unshort,
+ then also unshort, else long */
+
+typedef unshort sect_nr;
+
+typedef long zone_type; /* zone size */
+typedef unshort mask_bits; /* mode bits */
+typedef unshort dev_nr; /* major | minor device number */
+typedef char links; /* number of links to an inode */
+typedef long real_time; /* real time in seconds since Jan 1, 1970 */
+typedef long file_pos; /* position in, or length of, a file */
+typedef short uid; /* user id */
+typedef char gid; /* group id */
+
+/* Tables sizes */
+#define NR_ZONE_NUMS 9 /* # zone numbers in an inode */
+#define NAME_SIZE 14 /* # bytes in a directory component */
+
+/* Miscellaneous constants */
+#define SUPER_MAGIC 0x137F /* magic number contained in super-block */
+#define SUPER_MAGIC2 0x138F /* Secondary magic 30 char names */
+
+#define BOOT_BLOCK (block_nr)0 /* block number of boot block */
+#define SUPER_BLOCK (block_nr)1 /* block number of super block */
+#define ROOT_INODE (inode_nr)1 /* inode number for root directory */
+
+/* Derived sizes */
+#define NR_DZONE_NUM (NR_ZONE_NUMS-2) /* # zones in inode */
+#define INODES_PER_BLOCK (BLOCK_SIZE/sizeof(d_inode)) /* # inodes/disk blk */
+#define NR_INDIRECTS (BLOCK_SIZE/sizeof(zone_nr)) /* # zones/indir blk */
+#define INTS_PER_BLOCK (BLOCK_SIZE/sizeof(int)) /* # integers/blk */
+
+struct super_block {
+ inode_nr s_ninodes; /* # usable inodes on the minor device */
+ zone_nr s_nzones; /* total device size, including bit maps etc */
+ unshort s_imap_blocks; /* # of blocks used by inode bit map */
+ unshort s_zmap_blocks; /* # of blocks used by zone bit map */
+ zone_nr s_firstdatazone; /* number of first data zone */
+ short s_log_zone_size; /* log2 of blocks/zone */
+ file_pos s_max_size; /* maximum file size on this device */
+ short s_magic; /* magic number to recognize super-blocks */
+
+} ;
+
+/* Type definitions local to the File System. */
+typedef struct { /* directory entry */
+ inode_nr d_inum; /* inode number */
+ char d_name[NAME_SIZE]; /* character string */
+} dir_struct;
+
+/* Declaration of the disk inode used in rw_inode(). */
+typedef struct { /* disk inode. Memory inode is in "inotab.h" */
+ mask_bits i_mode; /* file type, protection, etc. */
+ uid i_uid; /* user id of the file's owner */
+ file_pos i_size; /* current file size in bytes */
+ real_time i_modtime; /* when was file data last changed */
+ gid i_gid; /* group number */
+ links i_nlinks; /* how many links to this file */
+ zone_nr i_zone[NR_ZONE_NUMS]; /* block nums for direct, ind, and dbl ind */
+} d_inode;
+
diff -ruN ./elks-stuff/elkscmd/bootblocks/minix.sym ./elks/elkscmd/bootblocks/minix.sym
--- ./elks-stuff/elkscmd/bootblocks/minix.sym 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/bootblocks/minix.sym 2004-05-09 13:36:50.000000000 -0400
@@ -0,0 +1,137 @@
++ 00000500 ----- $start
++ 00000900 ----- $end
+0 FFFFFFFE ---A- ..FFFF
+0 000005B7 ---A- .1
+0 000007A0 ---A- .10
+0 0000078A ---A- .11
+0 00000813 ---A- .12
+0 00000811 ---A- .13
+0 000007C6 ---A- .14
+0 000007F2 ---A- .15
+0 000007D0 ---A- .16
+0 000007F0 ---A- .17
+0 000007D7 ---A- .18
+0 00000896 ---A- .19
+0 00000823 ---A- .1A
+0 00000893 ---A- .1B
+0 0000088C ---A- .1C
+0 0000082B ---A- .1D
+0 00000869 ---A- .1E
+0 0000083F ---A- .1F
+0 000005AD ---A- .2
+0 00000869 ---A- .20
+0 00000867 ---A- .21
+0 0000083F ---A- .22
+0 0000085E ---A- .23
+0 00000845 ---A- .24
+0 0000085C ---A- .25
+0 0000084B ---A- .26
+0 00000867 ---A- .27
+0 00000865 ---A- .28
+0 0000088C ---A- .29
+0 0000087E ---A- .2A
+0 00000893 ---A- .2B
+0 000006B7 ---A- .3
+0 00000697 ---A- .4
+0 000006B4 ---A- .5
+0 000006AC ---A- .6
+0 000006A3 ---A- .7
+0 00000716 ---A- .8
+0 0000070E ---A- .9
+0 00000728 ---A- .A
+0 00000725 ---A- .B
+0 0000071E ---A- .C
+0 00000728 ---A- .D
+0 00000732 ---A- .E
+0 0000072F ---A- .F
+0 00000738 ---A- .FFFF
+0 00007C00 ---A- BOOTADDR
+0 00000F00 ---A- _b_inode
+0 00000900 ---A- _b_super
+0 00001300 ---A- _b_zone
+0 00000542 ---A- _bootfile
+0 00000540 ---A- _dinode
+0 000008E9 ---A- _dir_32
+0 00001700 ---A- _directory
+0 000008E5 ---A- _dirptr
+0 000008DF ---A- _end_zone
+0 00000570 ---A- _firstsect
+0 000008E7 ---A- _flength
+0 00000615 ---A- _get_now
+0 000008E1 ---A- _indirect
+0 0000053E ---A- _inode
+0 00000574 ---A- _lastsect
+0 000008E3 ---A- _ldaddr
+0 000005A0 ---A- _load_block
+0 00000665 ---A- _load_sect
+0 00000572 ---A- _loadaddr
+0 0000056E ---A- _loadcount
+0 00000700 E--A- _loadprog
+0 000008DB ---A- _n_sectors
+0 000008DD ---A- _next_zone
+0 00000576 ---A- _nogood
+0 0000064B ---A- _probe_sectors
+0 000006E7 ---A- _prt_crlf
+0 000006F0 ---A- _prt_dot
+0 0000089B ---A- _runprog
+0 000005DF ---A- _set_bpb
+0 00000608 ---A- _unset_bpb
+0 000006D0 ---A- _zero_block
+0 000008CB ---A- binfile
+0 0000050F ---A- bios_disk
+0 0000050B ---A- bios_tabl
+0 000006FE E--A- bootblock_magic
+0 00000542 E--A- bootfile
+0 000006DE ---A- code
+0 0000053E E--A- codestart
+0 00000540 E--A- dinode
+0 00000646 ---A- disksizes
+0 00000536 ---A- dos4_fattype
+0 0000052B ---A- dos4_label
+0 00000520 ---A- dos4_maxsect
+0 00000524 ---A- dos4_phy_drive
+0 00000527 ---A- dos4_serial
+0 0000050D ---A- dos_clust
+0 00000516 ---A- dos_fatlen
+0 0000051A ---A- dos_heads
+0 0000051C ---A- dos_hidden
+0 00000513 ---A- dos_maxsect
+0 00000515 ---A- dos_media
+0 00000510 ---A- dos_nfat
+0 00000511 ---A- dos_nroot
+0 0000050E ---A- dos_resv
+0 0000050B ---A- dos_sect
+0 00000518 ---A- dos_spt
+0 00000503 ---A- dos_sysid
+0 0000050B E--A- dosfs_stat
+0 000006FA ---A- end_of_part1
+0 000008EB ---A- end_of_prog
+0 00000590 ---A- fail_fs
+0 00000527 ---A- floppy_temp
+0 00000664 ---A- got_sectors
+0 00000B00 E--A- helper
+0 00000F00 E--A- helper_end
+0 000008D6 ---A- idiv_u
+0 000008CF ---A- imodu
+0 000008C1 ---A- impure
+0 0000053E E--A- inode
+0 000008DB ---A- libend
+0 000008CF ---A- libstuff
+0 0000055A ---A- loopy
+0 00000587 ---A- min_eos
+0 00000579 ---A- min_nextc
+0 00000640 ---A- no_load
+0 000006F2 ---A- outch
+0 000006BE ---A- partition_1
+0 000006CE ---A- partition_2
+0 000006DE ---A- partition_3
+0 000006EE ---A- partition_4
+0 00001700 ---A- probe_buf
+0 0000064E ---A- probe_loop
+0 00000618 ---A- retry_get
+0 00000550 ---A- skip_vars
+0 00000500 ---A- start
+0 00000000 ---R- sysboot.s
+0 00000500 ---A- sysboot_start
+0 000008EB ---A- varend
+0 000008DB ---A- vars
diff -ruN ./elks-stuff/elkscmd/bootblocks/minix_elks.c ./elks/elkscmd/bootblocks/minix_elks.c
--- ./elks-stuff/elkscmd/bootblocks/minix_elks.c 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/bootblocks/minix_elks.c 2004-04-18 15:04:37.000000000 -0400
@@ -0,0 +1,152 @@
+
+#define __ASSEMBLY__
+
+#asm
+#include "minix.v"
+
+! Must match minix.c ...
+#define LOADSEG (0x1000)
+
+! Must match ELKS
+#define ELKS_INITSEG (0x0100)
+#define ELKS_SYSSEG (0x1000)
+
+org minix_helper
+
+ push cs
+ pop ds
+ xor ax,ax
+ mov es,ax
+ mov ss,ax
+ mov sp,ax
+
+ mov cx,#$200 ! Move 512 words
+ mov si,ax ! Current load address.
+ mov di,#minix_helper ! To the correct address.
+ rep
+ movsw
+
+ mov ds,ax
+ jmpi code,0
+
+msg_p2:
+ .asciz "\r\nLoading ELKS kernel\r\n"
+
+msg_p3:
+ .asciz "Starting ...\r\n"
+
+aint_elks:
+ .asciz "Not an ELKS image!"
+
+elks_name:
+ .asciz "linux"
+ .byte 0,0,0,0,0,0,0,0,0
+
+dispmsg: ! SI now has pointer to a message
+ lodsb
+ cmp al,#0
+ jz EOS
+ mov bx,#7
+ mov ah,#$E ! Can't use $13 cause that's AT+ only!
+ int $10
+ jmp dispmsg
+EOS:
+ ret
+
+code:
+ mov si,#msg_p2
+ call dispmsg
+
+ mov ax,minix_dinode ! In the same directory.
+ mov minix_inode,ax
+
+ mov cx,#14
+ mov si,#elks_name
+ mov di,#minix_bootfile
+ rep
+ movsb
+
+ call minix__loadprog
+ ! Ok, now loaded "boot/linux" (or so)
+ mov si,#msg_p3
+ call dispmsg
+
+ call kill_motor ! For kernels without a floppy driver.
+!
+ mov ax,#LOADSEG
+ mov ds,ax
+
+ mov ax,$1E6 ! Check for ELKS magic number
+ cmp ax,#$4C45
+ jnz not_elks
+ mov ax,$1E8
+ cmp ax,#$534B
+ jz boot_it
+not_elks:
+ xor ax,ax
+ mov ds,ax
+ mov si,#aint_elks
+ call dispmsg
+ xor ax,ax
+ int $16
+ jmpi $0,$FFFF
+
+boot_it:
+ mov ax,#ELKS_INITSEG
+ mov es,ax
+
+ mov bl,497 ! Fetch number of setup sects.
+ xor bh,bh
+ inc bx
+ mov ax,500 ! Fetch system size
+ mov cl,#5
+ add ax,#31
+ shr ax,cl
+ mov dx,ax
+
+looping: ! Put the setup where it belongs
+ call copy_sect
+ dec bx
+ jnz looping
+
+ mov ax,#ELKS_SYSSEG
+ mov es,ax
+
+looping2: ! Put the body code in the right place.
+ call copy_sect
+ dec dx
+ jnz looping2
+
+ ! Ok, everything should be where it belongs call it.
+ mov ax,#ELKS_INITSEG
+ mov ds,ax
+ mov es,ax
+ mov ss,ax
+ mov sp,#0x4000-12
+ jmpi 0,ELKS_INITSEG+$20
+
+copy_sect:
+ mov cx,#256
+ xor si,si
+ xor di,di
+ rep
+ movsw
+
+ mov ax,ds
+ add ax,#32
+ mov ds,ax
+ mov ax,es
+ add ax,#32
+ mov es,ax
+ ret
+
+kill_motor:
+ push dx
+ mov dx,#0x3f2
+ xor al, al
+ outb
+ pop dx
+ ret
+
+#endasm
+
diff -ruN ./elks-stuff/elkscmd/bootblocks/minix_elks.sym ./elks/elkscmd/bootblocks/minix_elks.sym
--- ./elks-stuff/elkscmd/bootblocks/minix_elks.sym 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/bootblocks/minix_elks.sym 2004-05-09 13:36:50.000000000 -0400
@@ -0,0 +1,26 @@
++ 00000B00 ----- $start
++ 00000C19 ----- $end
+0 00000B72 ---A- EOS
+0 00000B42 ---A- aint_elks
+0 00000BBE ---A- boot_it
+0 00000B73 ---A- code
+0 00000BF8 ---A- copy_sect
+0 00000B64 ---A- dispmsg
+0 00000B55 ---A- elks_name
+0 00000C10 ---A- kill_motor
+0 00000BD6 ---A- looping
+0 00000BE1 ---A- looping2
+0 00000700 ---A- minix__loadprog
+0 000006FE ---A- minix_bootblock_magic
+0 00000542 ---A- minix_bootfile
+0 0000053E ---A- minix_codestart
+0 00000540 ---A- minix_dinode
+0 0000050B ---A- minix_dosfs_stat
+0 00000B00 ---A- minix_helper
+0 00000F00 ---A- minix_helper_end
+0 0000053E ---A- minix_inode
+0 00000400 ---A- minix_size
+0 00000500 ---A- minix_start
+0 00000B1B ---A- msg_p2
+0 00000B33 ---A- msg_p3
+0 00000BAB ---A- not_elks
diff -ruN ./elks-stuff/elkscmd/disk_utils/Makefile ./elks/elkscmd/disk_utils/Makefile
--- ./elks-stuff/elkscmd/disk_utils/Makefile 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/disk_utils/Makefile 2004-04-20 21:22:58.000000000 -0400
@@ -39,6 +39,7 @@
SPROGS=mkfs

all: $(PROGS)
+ mkdir $(TARGET_MNT)/sbin

rfs: install

diff -ruN ./elks-stuff/elkscmd/disk_utils/mkfs.c ./elks/elkscmd/disk_utils/mkfs.c
--- ./elks-stuff/elkscmd/disk_utils/mkfs.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/disk_utils/mkfs.c 2004-04-18 18:57:36.000000000 -0400
@@ -162,7 +162,7 @@
exit(status);
}

-#define usage() fatal_error("Usage: mkfs /dev/name blocks # Max blocks=65535\n",16)
+#define usage() fatal_error("Usage: mkfs /dev/name blocks number of Max blocks=65535\n",16)
#define die(str) fatal_error("mkfs: " str "\n",8)

void write_tables(void)
diff -ruN ./elks-stuff/elkscmd/errors ./elks/elkscmd/errors
--- ./elks-stuff/elkscmd/errors 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/errors 2004-04-19 16:56:21.000000000 -0400
@@ -0,0 +1 @@
+as: error opening input file
diff -ruN ./elks-stuff/elkscmd/file_utils/Makefile ./elks/elkscmd/file_utils/Makefile
--- ./elks-stuff/elkscmd/file_utils/Makefile 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/file_utils/Makefile 2004-04-20 21:23:46.000000000 -0400
@@ -39,7 +39,7 @@
PRGS=cat chgrp chmod chown cmp cp dd grep ln ls mkdir mkfifo mknod \
more mv rm rmdir sync touch

-MIN_PRGS=cat chgrp chmod chown cmp cp l ls mknod mkdir mv rm rmdir \
+MIN_PRGS=cat chgrp chmod chown cmp cp ln ls mknod mkdir mv rm rmdir \
sync touch

SMIN_PRGS=cat cp ls mkdir sync
diff -ruN ./elks-stuff/elkscmd/file_utils/l.c ./elks/elkscmd/file_utils/l.c
--- ./elks-stuff/elkscmd/file_utils/l.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/file_utils/l.c 1999-02-16 13:23:00.000000000 -0500
@@ -1,5 +1,5 @@
/* l.c - A short version of `ls'
- * Sun Feb 8 16:28:03 EST 1998 - claudio@conectiva.com (Claudio Matsuoka)
+ * Sun Feb 8 16:28:03 EST 1998 - claudio@pos.inf.ufpr.br (Claudio Matsuoka)
*
* Based on the ls.c sources Copyright (c) 1993 by David I. Bell
*/
diff -ruN ./elks-stuff/elkscmd/file_utils/ls.c ./elks/elkscmd/file_utils/ls.c
--- ./elks-stuff/elkscmd/file_utils/ls.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/file_utils/ls.c 2002-01-16 14:04:41.000000000 -0500
@@ -9,7 +9,7 @@
* - Added -C option to print 5 across screen.
* 30-Jan-1998 ajr@ecs.soton.ac.uk (Al Riddoch)
* - Made -C default behavoir.
- * 02-Feb-1998 claudio@conectiva.com (Claudio Matsuoka)
+ * 02-Feb-1998 claudio@pos.inf.ufpr.br (Claudio Matsuoka)
* - Options -a, -F and simple multicolumn output added
* 28-Nov-1999 mario.frasca@home.ict.nl (Mario Frasca)
* - Options -R -r added
@@ -18,9 +18,6 @@
* 13-Jan-2002 rhw@MemAlpha.cx (Riley Williams)
* - Reformatted source consistently.
* - Added -A option: -a excluding . and ..
- * 28-May-2004 claudio@conectiva.com (Claudio Matsuoka)
- * - Fixed sort direction, keeps qsort and strcmp consistent
- * - Removed alias to 'dir' (doesn't seem to belong here)
*/

#if !defined(DEBUG)
@@ -74,7 +71,7 @@
( (c=name[1]) && (c!='.') ) || (name[2]&&c)

-static int cols = 0, col = 0, reverse = 1;
+static int cols = 0, col = 0, reverse=-1;
static char fmt[16] = "%s";

@@ -84,7 +81,7 @@
int namesort(a, b)
const char **a, **b;
{
- return reverse * strcmp(*a, *b);
+ return reverse*strcmp(*a, *b);
}

struct Stack
@@ -468,6 +465,8 @@
/*
* Set relevant flags for command name
*/
+ if (!strcmp(*argv,"dir"))
+ flags |= LSF_LONG;

while ( --argc && ((cp = * ++argv)[0]=='-') ) {
while (*++cp) {
diff -ruN ./elks-stuff/elkscmd/inet/telnet/ttn.c ./elks/elkscmd/inet/telnet/ttn.c
--- ./elks-stuff/elkscmd/inet/telnet/ttn.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/inet/telnet/ttn.c 2004-04-18 19:14:13.000000000 -0400
@@ -27,14 +27,14 @@
#include <linuxmt/time.h>
#include "../httpd/mylib.h"

-#define assert(a)
+/* #define assert(a)- Huh? */
#else
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif

-#include <netdb.h>
+/* #include <netdb.h> And where is this file supposed to come from? */

#include "ttn.h"

diff -ruN ./elks-stuff/elkscmd/levee/editcor.c ./elks/elkscmd/levee/editcor.c
--- ./elks-stuff/elkscmd/levee/editcor.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/levee/editcor.c 2004-04-18 19:03:09.000000000 -0400
@@ -444,14 +444,16 @@
strcat(gcb,"c$"); break;
case 'Y': /* yank ... */
strcat(gcb,"y$"); break;
+/*
case '\x06': /* scroll up one page */
- strcpy(gcb,"22\x04"); break;
+/* strcpy(gcb,"22\x04"); break;
case '\x02': /* ... down one page */
- strcpy(gcb,"22\x15"); break;
+/* strcpy(gcb,"22\x15"); break;
case '\x05': /* scroll up one line */
- strcpy(gcb,"1\x04"); break;
+/* strcpy(gcb,"1\x04"); break;
case '\x19': /* ... down one line */
- strcpy(gcb,"1\x15"); break;
+/* strcpy(gcb,"1\x15"); break;
+*/
default:
error();
return 0;
diff -ruN ./elks-stuff/elkscmd/levee/insert.c ./elks/elkscmd/levee/insert.c
--- ./elks-stuff/elkscmd/levee/insert.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/levee/insert.c 2004-04-18 19:06:38.000000000 -0400
@@ -85,8 +85,8 @@
Dflag = (cp==0 || core[cp-1]==EOL);
do {
if (Dflag)
- while ((cmd=peekc()) == '\x14' || cmd == '\x04') {
- if (readchar() == '\x14')
+ while ((cmd=peekc()) == 'b' /* This needs fixing*/ || cmd == 'b'/* This needs fixing */) {
+ if (readchar() == 'h'/*This need sfixing*/)
currDLE = min(COLS,currDLE+shiftwidth);
else
currDLE = max(0,currDLE-shiftwidth);
diff -ruN ./elks-stuff/elkscmd/levee/misc.c ./elks/elkscmd/levee/misc.c
--- ./elks-stuff/elkscmd/levee/misc.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/levee/misc.c 2004-04-18 19:09:13.000000000 -0400
@@ -392,10 +392,10 @@
*size = (ip-start);
return (c==ESC) ? ESC : EOL;
}
- else if ((!beautify) || c == TAB || c == '\x16'
+ else if ((!beautify) || c == TAB || c == 'h' /*This needs fixing*/
|| (c >= ' ' && c <= '~')) {
if (ip < endd) {
- if (c == '\x16')
+ if (c == '\x16f'/*This needs fixing*/)
c = readchar();
switch (cclass(c)) {
case 0 : ixp++; break;
diff -ruN ./elks-stuff/elkscmd/rootfs_template/dev/MAKEDEV ./elks/elkscmd/rootfs_template/dev/MAKEDEV
--- ./elks-stuff/elkscmd/rootfs_template/dev/MAKEDEV 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/rootfs_template/dev/MAKEDEV 1969-12-31 19:00:00.000000000 -0500
@@ -1,264 +0,0 @@
-#!/bin/sh
-
-# Devices are generated by this script in the same order that they are listed
-# in the Documentation/devices.txt file in the Linux 2.4.18 and5.21 kernel
-# sources. This includes devices that are not currently relevant to ELKS, to
-# encourage the use of common node numbers when these devices are eventually
-# implemented.
-#
-# Where different node numbers are currently used by ELKS, the current ELKS
-# node numbers are generated by lines labelled "Currently" and the relevant
-# Linux node numbers are generated by lines labelled "Ought to be".
-#
-# Refer to the MAKESET command, also in this directory, for usage details.
-
-LINK=/bin/ln
-MKDEV=/bin/mknod
-MKSET=/dev/MAKESET
-
-##############################################################################
-# Ensure required auxilliary script is present.
-
-if ! /bin/test -f "$MKSET"
-then
- echo ERROR: \"$MKSET\" script missing, unable to continue.
- exit 1
-fi
-
-##############################################################################
-# Create memory devices.
-
- $MKDEV mem c 1 1
- $MKDEV kmem c 1 2
- $MKDEV null c 1 3
-# $MKDEV port c 1 4
- $MKDEV zero c 1 5
-# $MKDEV core c 1 6
- $MKDEV full c 1 7
-# $MKDEV random c 1 8
-# $MKDEV urandom c 1 9
-# $MKDEV aio c 1 10
-
-##############################################################################
-# RAM disks.
-
- $MKSET 0 7 $MKDEV ram b 1
-
- $LINK ram1 ramdisk
-
-##############################################################################
-# Pseudo-TTY master devices. These are not yet supported by the ELKS kernel.
-
-# $MKSET 0 15 $MKDEV ptyp x 2
-# $MKSET 16 15 $MKDEV ptyq x 2
-# $MKSET 32 15 $MKDEV ptyr x 2
-# $MKSET 48 15 $MKDEV ptys x 2
-# $MKSET 64 15 $MKDEV ptyt x 2
-# $MKSET 80 15 $MKDEV ptyu x 2
-# $MKSET 96 15 $MKDEV ptyv x 2
-# $MKSET 112 15 $MKDEV ptyw x 2
-# $MKSET 128 15 $MKDEV ptyx x 2
-# $MKSET 144 15 $MKDEV ptyy x 2
-# $MKSET 160 15 $MKDEV ptyz x 2
-# $MKSET 176 15 $MKDEV ptya x 2
-# $MKSET 192 15 $MKDEV ptyb x 2
-# $MKSET 208 15 $MKDEV ptyc x 2
-# $MKSET 224 15 $MKDEV ptyd x 2
-# $MKSET 240 15 $MKDEV ptye x 2
-
-##############################################################################
-# Floppy diskettes. Only the auto-detect nodes are listed.
-
- $MKDEV fd0 b 3 128 # Currently.
- $MKDEV fd1 b 3 192 # Currently.
-
-# $MKSET 0 3 $MKDEV fd b 2 # Ought to be.
-
-##############################################################################
-# Pseudo-TTY master devices. These are not yet supported by the ELKS kernel.
-
-# $MKSET 0 15 $MKDEV ttyp x 3
-# $MKSET 16 15 $MKDEV ttyq x 3
-# $MKSET 32 15 $MKDEV ttyr x 3
-# $MKSET 48 15 $MKDEV ttys x 3
-# $MKSET 64 15 $MKDEV ttyt x 3
-# $MKSET 80 15 $MKDEV ttyu x 3
-# $MKSET 96 15 $MKDEV ttyv x 3
-# $MKSET 112 15 $MKDEV ttyw x 3
-# $MKSET 128 15 $MKDEV ttyx x 3
-# $MKSET 144 15 $MKDEV ttyy x 3
-# $MKSET 160 15 $MKDEV ttyz x 3
-# $MKSET 176 15 $MKDEV ttya x 3
-# $MKSET 192 15 $MKDEV ttyb x 3
-# $MKSET 208 15 $MKDEV ttyc x 3
-# $MKSET 224 15 $MKDEV ttyd x 3
-# $MKSET 240 15 $MKDEV ttye x 3
-
-##############################################################################
-# Direct IDE disks, Primary channel.
-
- $MKSET 0 63 $MKDEV hda d 5 # Currently.
- $MKSET 64 63 $MKDEV hdb d 5 # Currently.
-
-# $MKSET 0 63 $MKDEV hda d 3 # Ought to be.
-# $MKSET 64 63 $MKDEV hdb d 3 # Ought to be.
-
-##############################################################################
-# Virtual consoles. Note that tty4 through tty7 can't be enabled at this
-# time because of the possible conflict with ttyS0 through ttyS3 which
-# used to use the node numbers these now use. However, it is expected that
-# this restriction can be removed in the near future.
-
- $MKSET 0 3 $MKDEV tty c 4 # Currently
-# $MKSET 0 15 $MKDEV tty c 4 # Soon to be
-
-# Serial ports, as detected by the ROM BIOS.
-
- $MKSET 64 3 $MKDEV ttyS c 4
-
-##############################################################################
-# Alternate TTY devices. These are not yet supported.
-
-# $MKDEV tty c 5 0
-# $MKDEV console c 5 1
-# $MKDEV ptmx c 5 2
-
-##############################################################################
-# Parallel devices, as detected by the ROM BIOS.
-
- $MKSET 0 3 $MKDEV lp c 6
-
-##############################################################################
-# Loopback devices. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV loop c 7
-
-##############################################################################
-# SCSI disks. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV sda d 8
-# $MKSET 16 15 $MKDEV sdb d 8
-# $MKSET 32 15 $MKDEV sdc d 8
-# $MKSET 48 15 $MKDEV sdd d 8
-# $MKSET 64 15 $MKDEV sde d 8
-# $MKSET 80 15 $MKDEV sdf d 8
-# $MKSET 96 15 $MKDEV sdg d 8
-# $MKSET 112 15 $MKDEV sdh d 8
-# $MKSET 128 15 $MKDEV sdi d 8
-# $MKSET 144 15 $MKDEV sdj d 8
-# $MKSET 160 15 $MKDEV sdk d 8
-# $MKSET 176 15 $MKDEV sdl d 8
-# $MKSET 192 15 $MKDEV sdm d 8
-# $MKSET 208 15 $MKDEV sdn d 8
-# $MKSET 224 15 $MKDEV sdo d 8
-# $MKSET 240 15 $MKDEV sdp d 8
-
-##############################################################################
-# SCSI tapes. These are not yet supported.
-
-# $MKSET 0 31 $MKDEV st c 9
-# $MKSET 32 31 $MKDEV st c 9 l
-# $MKSET 64 31 $MKDEV st c 9 m
-# $MKSET 96 31 $MKDEV st c 9 a
-# $MKSET 128 31 $MKDEV nst c 9
-# $MKSET 160 31 $MKDEV nst c 9 l
-# $MKSET 192 31 $MKDEV nst c 9 m
-# $MKSET 224 31 $MKDEV nst c 9 a
-
-##############################################################################
-# Metadisk (RAID) devices. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV md b 9
-
-##############################################################################
-# SCSI CD-ROM devices. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV scd b 11
-
-##############################################################################
-# MSCDEX CD-ROM devices. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV doscd b 12
-
-##############################################################################
-# 8-bit MFM/RLL controllers. These are not yet supported.
-
-# $MKSET 0 63 $MKDEV xda b 13
-# $MKSET 64 63 $MKDEV xdb b 13
-
-##############################################################################
-# BIOS hard disks.
-
- $MKSET 0 63 $MKDEV bda d 3 # Currently
- $MKSET 64 63 $MKDEV bdb d 3 # Currently
- $MKSET 128 63 $MKDEV bdc d 3 # Currently
- $MKSET 192 63 $MKDEV bdd d 3 # Currently
-
-# $MKSET 0 63 $MKDEV bda d 14 # Ought to be
-# $MKSET 64 63 $MKDEV bdb d 14 # Ought to be
-# $MKSET 128 63 $MKDEV bdc d 14 # Ought to be
-# $MKSET 192 63 $MKDEV bdd d 14 # Ought to be
-
-##############################################################################
-# Joysticks. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV js c 15
-# $MKSET 128 15 $MKDEV djs c 15
-
-##############################################################################
-# Generic SCSI devics. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV sg c 21
-
-##############################################################################
-# Direct IDE disks, Secondary channel. These are not yet supported.
-
-# $MKSET 0 63 $MKDEV hdc d 22
-# $MKSET 64 63 $MKDEV hdd d 22
-
-##############################################################################
-# Direct IDE disks, Tertiary channel. These are not yet supported.
-
-# $MKSET 0 63 $MKDEV hde d 33
-# $MKSET 64 63 $MKDEV hdf d 33
-
-##############################################################################
-# Z80-SIO devices. These are not yet supported.
-
-# $MKSET 0 7 $MKDEV scc c 34
-
-##############################################################################
-# Direct IDE disks, Quaternary channel. These are not yet supported.
-
-# $MKSET 0 63 $MKDEV hde d 34
-# $MKSET 64 63 $MKDEV hdf d 34
-
-##############################################################################
-# Direct IDE disks, Quinternary channel. These are not yet supported.
-
-# $MKSET 0 63 $MKDEV hdg d 56
-# $MKSET 64 63 $MKDEV hdh d 56
-
-##############################################################################
-# Direct IDE disks, Quaternary channel. These are not yet supported.
-
-# $MKSET 0 63 $MKDEV hdi d 57
-# $MKSET 64 63 $MKDEV hdj d 57
-
-##############################################################################
-# SCSI Media Changer. These are not yet supported.
-
-# $MKSET 0 15 $MKDEV sch c 86
-
-##############################################################################
-# I2C bus drivers. These are not yet supported.
-
-# $MKSET 0 7 $MKDEV i2c c 89
-
-##############################################################################
-# Conrad Electronic Parallel Port Radio Clocks. These are not yet supported.
-
-# $MKSET 0 1 $MKDEV pcfclock c 181
-
-##############################################################################
-# EOF.
diff -ruN ./elks-stuff/elkscmd/rootfs_template/dev/MAKESET ./elks/elkscmd/rootfs_template/dev/MAKESET
--- ./elks-stuff/elkscmd/rootfs_template/dev/MAKESET 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/rootfs_template/dev/MAKESET 1969-12-31 19:00:00.000000000 -0500
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-if [ $# -lt 6 -o $# -gt 7 ]; then
- echo
- echo "Usage: makeset min count cmd prefix type major [suffix]"
- echo
- echo "where min is the minor of the first node to make,"
- echo " count is the number of the last node to make,"
- echo " cmd is the command to make a node,"
- echo " prefix is the node name prefix,"
- echo " type is the type selector for the node,"
- echo " major is the major number for the node,"
- echo " and suffix is a suffix to append to the node names."
- echo
- echo "The following type selectors are supported:"
- echo
- echo " b Block device, all nodes have numeric suffix."
- echo " d Block device, first node is raw device without numeric suffix."
- echo
- echo " c Character device with decimal numeric suffix."
- echo " x Character device with hexadecimal numeric suffix."
- echo
-else
- N=0
- while [ $N -le $2 ]; do
- P=`expr $N + $1`
- case ".$5" in
- .b) eval $3 $4$N$7 $5 $6 $P
- ;;
- .c) eval $3 $4$N$7 $5 $6 $P
- ;;
- .d) if [ $N -gt 0 ]; then
- eval $3 $4$N$7 $5 $6 $P
- else
- eval $3 $4$7 $5 $6 $P
- fi
- ;;
- .x) if [ $N -gt 9 ]; then
- R=`echo 123456789abcdef | cut -b $N`
- eval $3 $4$R$7 c $6 $P
- else
- eval $3 $4$N$7 c $6 $P
- fi
- ;;
- esac
- N=`expr $N + 1`
- done
-fi
diff -ruN ./elks-stuff/elkscmd/rootfs_template/etc/rc.d/rc.sysinit ./elks/elkscmd/rootfs_template/etc/rc.d/rc.sysinit
--- ./elks-stuff/elkscmd/rootfs_template/etc/rc.d/rc.sysinit 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/rootfs_template/etc/rc.d/rc.sysinit 2002-07-15 01:39:30.000000000 -0400
@@ -18,19 +18,20 @@
stty $ttybaud < $sliptty
echo -n ' stty'
ktcp $localip $sliptty &
- echo ' ktcp'
+ echo -n ' ktcp'
+
+ echo ''

echo -n "Starting network daemons: "
for daemon in ftpd httpd
do
if test -f /bin/$daemon
then
- echo -n " $daemon"
$daemon &
+ echo -n " $daemon"
fi
done
- echo .
-
+ echo ''
fi

#
Binary files ./elks-stuff/elkscmd/rootfs_template.tar and ./elks/elkscmd/rootfs_template.tar differ
Binary files ./elks-stuff/elkscmd/rootfs_template.tar.gz and ./elks/elkscmd/rootfs_template.tar.gz differ
diff -ruN ./elks-stuff/elkscmd/sys_utils/Makefile ./elks/elkscmd/sys_utils/Makefile
--- ./elks-stuff/elkscmd/sys_utils/Makefile 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/sys_utils/Makefile 2004-04-21 17:38:24.000000000 -0400
@@ -6,7 +6,7 @@
#
# Include standard packaging commands.

-MIN_BIN = getty init kill login mount passwd ps swapon meminfo reboot umount
+MIN_BIN = getty init kill login mount passwd ps meminfo reboot umount
MIN_LIB =
MIN_SBIN = clock exitemu getty init reboot
MIN_USR_BIN = meminfo passwd
@@ -36,26 +36,29 @@
###############################################################################

PRGS = getty kill man mount reboot umount clock exitemu who ps \
- init login passwd knl
+ init login passwd knl meminfo

-NETPRGS=init getty login kill mount umount passwd reboot ps swapon meminfo who
+NETPRGS=init getty login kill mount umount passwd reboot ps meminfo who

-MIN_PRGS=init getty login kill mount reboot umount clock exitemu ps swapon meminfo
+MIN_PRGS=init getty login kill mount reboot umount clock exitemu ps meminfo

SMIN_PRGS = init mount umount

all: $(PRGS)

rfs: all
+ mkdir $(TARGET_MNT)/bin
cp -p $(PRGS) $(TARGET_MNT)/bin

net_rfs: all
cp -p $(NETPRGS) $(TARGET_MNT)/bin

min_rfs: all
+ mkdir $(TARGET_MNT)/bin
cp -p $(MIN_PRGS) $(TARGET_MNT)/bin

smin_rfs: all
+ mkdir $(TARGET_MNT)/bin
cp -p $(SMIN_PRGS) $(TARGET_MNT)/bin

clean:
@@ -80,9 +83,6 @@
meminfo: meminfo.c
$(CC) $(CFLAGS) $(LDFLAGS) meminfo.c -o meminfo -H 100

-swapon: swapon.c
- $(CC) $(CFLAGS) $(LDFLAGS) swapon.c -o swapon -H 100
-
new_init: init.c utent.o
$(CC) $(CFLAGS) $(LDFLAGS) init.c utent.o -o init

diff -ruN ./elks-stuff/elkscmd/sys_utils/qsort.c ./elks/elkscmd/sys_utils/qsort.c
--- ./elks-stuff/elkscmd/sys_utils/qsort.c 2004-05-28 16:02:01.000000000 -0400
+++ ./elks/elkscmd/sys_utils/qsort.c 1999-02-16 13:23:00.000000000 -0500
@@ -9,7 +9,7 @@
*/

/*
- * Sun Feb 8 21:02:15 EST 1998 claudio@conectiva.com (Claudio Matsuoka)
+ * Sun Feb 8 21:02:15 EST 1998 claudio@pos.inf.ufpr.br (Claudio Matsuoka)
* Changed sort direction
*/

diff -ruN ./elks-stuff/elkscmd/sysboot.s ./elks/elkscmd/sysboot.s
--- ./elks-stuff/elkscmd/sysboot.s 1969-12-31 19:00:00.000000000 -0500
+++ ./elks/elkscmd/sysboot.s 2004-04-19 21:56:00.000000000 -0400
@@ -0,0 +1,82 @@
+
+! The master boot sector will have setup a stack,
+! this is normally at 0:7c00 down.
+! DS, SS, CS and ES will all have value 0 so the execution address is 0:7c00
+! On entry the register SI will be pointer to the partition entry that
+! this sector was loaded from, DL is the drive.
+
+! Also if it's a standard Master boot DH will be the head, CX will be the
+! sector and cylinder, BX=7C00, AX=1, DI=7DFE, BP=SI. There's a reasonable
+! chance that this isn't true though.
+
+! The Master boot itself will have been loaded and run at $07c00
+! The BIOS must have setup a stack because interrupts are enabled
+! Little else can be assumed because DOS doesn`t assume anything either
+
+sysboot_start:
+j codestart
+nop ! DOS appears to _require_ this to identify an MSDOS disk!!
+
+.blkb sysboot_start+3-*
+public dosfs_stat
+dos_sysid: .ascii "LINUX" ! System ID
+ .byte 0,0,0
+dosfs_stat:
+dos_sect: .blkw 1 ! Sector size
+dos_clust: .blkb 1 ! Cluster size
+dos_resv: .blkw 1 ! Res-sector
+dos_nfat: .blkb 1 ! FAT count
+dos_nroot: .blkw 1 ! Root dir entries
+dos_maxsect: .blkw 1 ! Sector count (=0 if large FS)
+dos_media: .blkb 1 ! Media code
+dos_fatlen: .blkw 1 ! FAT length
+dos_spt: .blkw 1 ! Sect/Track
+dos_heads: .blkw 1 ! Heads
+dos_hidden: .blkw 2 ! Hidden sectors
+
+! Here down is DOS 4+ and probably not needed for floppy boots.
+
+dos4_maxsect: .blkw 2 ! Large FS sector count
+dos4_phy_drive: .blkb 1 ! Phys drive
+.blkb 1 ! Reserved
+.blkb 1 ! DOS 4
+
+floppy_temp:
+dos4_serial: .blkw 2 ! Serial number
+dos4_label: .blkb 11 ! Disk Label (DOS 4+)
+dos4_fattype: .blkb 8 ! FAT type
+
+!
+! This is where the code will be overlaid, the default is a hang
+.blkb sysboot_start+0x3E-*
+public codestart
+codestart:
+ j codestart
+
+! Partition table
+public bootblock_magic
+
+.blkb sysboot_start+0x1BE-*
+partition_1:
+.blkb 8 ! IN,SH,SS,ST,OS,EH,ES,ET
+.blkw 2 ! Linear position (0 based)
+.blkw 2 ! Linear length
+.blkb sysboot_start+0x1CE-*
+partition_2:
+.blkb 8 ! IN,SH,SS,ST,OS,EH,ES,ET
+.blkw 2 ! Linear position (0 based)
+.blkw 2 ! Linear length
+.blkb sysboot_start+0x1DE-*
+partition_3:
+.blkb 8 ! IN,SH,SS,ST,OS,EH,ES,ET
+.blkw 2 ! Linear position (0 based)
+.blkw 2 ! Linear length
+.blkb sysboot_start+0x1EE-*
+partition_4:
+.blkb 8 ! IN,SH,SS,ST,OS,EH,ES,ET
+.blkw 2 ! Linear position (0 based)
+.blkw 2 ! Linear length
+
+.blkb sysboot_start+0x1FE-*
+bootblock_magic:
+.word 0xAA55
diff -ruN ./elks-stuff/elksnet/ktcp/vjhc.c ./elks/elksnet/ktcp/vjhc.c
--- ./elks-stuff/elksnet/ktcp/vjhc.c 2004-05-28 16:01:54.000000000 -0400
+++ ./elks/elksnet/ktcp/vjhc.c 2004-04-20 22:08:26.000000000 -0400
@@ -113,10 +113,7 @@
}
}

-DEFUN
-(int ip_vjhc_compress, (pkt),
- pkt_ut *pkt
-)
+int ip_vjhc_compress(pkt_ut *pkt)
{
iphdr_t *ip_hdr, *oip_hdr;
tcphdr_t *tcp_hdr, *otcp_hdr;
@@ -127,107 +124,112 @@
__u32 delta, deltaA, deltaS;
__u16 cksum;

- if (pkt->p_size < IP_MIN_HDR_SIZE + TCP_MIN_HDR_SIZE)
+ if(pkt->p_size < IP_MIN_HDR_SIZE + TCP_MIN_HDR_SIZE)
{
#ifdef DEBUG
- if (opt_d) fprintf(stderr,"ip_vjhc_compress: packet too small %d\n",
- pkt->p_size);
+ if(opt_d)
+ {
+ fprintf(stderr,"ip_vjhc_compress: packet too small %d\n", pkt->p_size);
+ }
#endif
return PPP_TYPE_IP;
}
- ip_hdr= (iphdr_t *)(pkt->p_data + pkt->p_offset);
- if ((ntohs(ip_hdr->frag_off) &
- (IH_MORE_FRAGS | IH_FRAGOFF_MASK)) != 0)
+ ip_hdr = (iphdr_t *)(pkt->p_data + pkt->p_offset);
+ if((ntohs(ip_hdr->frag_off) & (IH_MORE_FRAGS | IH_FRAGOFF_MASK)) != 0)
{
#ifdef DEBUG
- if (opt_d) fprintf(stderr,"ip_vjhc_compress: fragmented packet\n");
+ if(opt_d)
+ {
+ fprintf(stderr,"ip_vjhc_compress: fragmented packet\n");
+ }
#endif
return PPP_TYPE_IP;
}
ip_hdr_len= (ip_hdr->version_ihl & IH_IHL_MASK) * 4;
tcp_hdr= (tcphdr_t *)(pkt->p_data + pkt->p_offset + ip_hdr_len);
- if ((tcp_hdr->flags & (TF_SYN | TF_FIN | TF_RST | TF_ACK)) !=
- TF_ACK)
+ if((tcp_hdr->flags & (TF_SYN | TF_FIN | TF_RST | TF_ACK)) != TF_ACK)
{
#ifdef DEBUG
- if (opt_d) fprintf(stderr,"ip_vjhc_compress: wrong flags in TCP header\n");
+ if(opt_d)
+ {
+ fprintf(stderr,"ip_vjhc_compress: wrong flags in TCP header\n");
+ }
#endif
return PPP_TYPE_IP;
}
tcp_hdr_len= TCP_DATAOFF(tcp_hdr); /* !!! */
tot_len= ip_hdr_len + tcp_hdr_len;
#ifdef DEBUG
- if (opt_d) {
- fprintf(stderr,"ip_vjhc_compress: packet with size %d\n\t",
- pkt->p_size);
- for (cp= (__u8 *)pkt->p_data+pkt->p_offset; cp < (__u8 *)pkt->p_data +
- pkt->p_offset + ip_hdr_len; cp++)
- {
- fprintf(stderr,"%x ", *cp);
- }
- fprintf(stderr,"\n\t");
- for (; cp < (__u8 *)pkt->p_data + pkt->p_offset + tot_len; cp++)
- {
- fprintf(stderr, "%x ", *cp);
- }
- fprintf(stderr, "\n\t");
- for (; cp < (__u8 *)pkt->p_data + pkt->p_offset + pkt->p_size; cp++)
- {
- fprintf(stderr, "%x ", *cp);
- }
- fprintf(stderr, "\n");
- }
+ if(opt_d)
+ {
+ fprintf(stderr,"ip_vjhc_compress: packet with size %d\n\t", pkt->p_size);
+ for (cp= (__u8 *)pkt->p_data+pkt->p_offset; cp < (__u8 *)pkt->p_data +pkt->p_offset + ip_hdr_len; cp++)
+ {
+ fprintf(stderr,"%x ", *cp);
+ }
+ fprintf(stderr,"\n\t");
+ for (; cp < (__u8 *)pkt->p_data + pkt->p_offset + tot_len; cp++)
+ {
+ fprintf(stderr, "%x ", *cp);
+ }
+ fprintf(stderr, "\n\t");
+ for(; cp < (__u8 *)pkt->p_data + pkt->p_offset + pkt->p_size; cp++)
+ {
+ fprintf(stderr, "%x ", *cp);
+ }
+ fprintf(stderr, "\n");
+ }
#endif
for (prev= NULL, state= xmit_head;; )
{
- if (ip_hdr->saddr == state->s_src_ip &&
- ip_hdr->daddr == state->s_dst_ip &&
- *(__u32 *)&tcp_hdr->sport ==
- state->s_srcdst_port)
+ if((ip_hdr->saddr == state->s_src_ip) && (ip_hdr->daddr == state->s_dst_ip) && (*(__u32 *)&tcp_hdr->sport == state->s_srcdst_port))
{
#ifdef DEBUG
- if (opt_d) fprintf(stderr, "ip_vjhc_compress: found entry\n");
+ if(opt_d)
+ {
+ fprintf(stderr, "ip_vjhc_compress: found entry\n");
+ }
#endif
- if (prev != NULL)
+ if(prev != NULL)
{
#ifdef DEBUG
- if (opt_d) fprintf(stderr, "ip_vjhc_compress: moving entry to front\n");
+ if(opt_d) fprintf(stderr, "ip_vjhc_compress: moving entry to front\n");
#endif
- prev->s_next= state->s_next;
- state->s_next= xmit_head;
- xmit_head= state;
+ prev->s_next = state->s_next;
+ state->s_next = xmit_head;
+ xmit_head = state;
}
break;
}
- next= state->s_next;
- if (next != NULL)
+ next = state->s_next;
+ if(next != NULL)
{
- prev= state;
- state= next;
+ prev = state;
+ state = next;
continue;
}
-
/* Not found */
- if (prev != NULL)
+ if(prev != NULL)
+ {
+ prev->s_next = state->s_next;
+ state->s_next = xmit_head;
+ xmit_head = state;
+ }
+ state->s_src_ip = ip_hdr->saddr;
+ state->s_dst_ip = ip_hdr->daddr;
+ state->s_srcdst_port = *(__u32 *)&tcp_hdr->sport;
+#ifdef DEBUG
+ if(opt_d)
{
- prev->s_next= state->s_next;
- state->s_next= xmit_head;
- xmit_head= state;
- }
- state->s_src_ip= ip_hdr->saddr;
- state->s_dst_ip= ip_hdr->daddr;
- state->s_srcdst_port= *(__u32 *)&tcp_hdr->sport;
-#ifdef DEBUG
- if (opt_d) fprintf(stderr,"ip_vjhc_compress: new entry: %x, %x, %x\n",
- state->s_src_ip, state->s_dst_ip,
- state->s_srcdst_port );
+ fprintf(stderr,"ip_vjhc_compress: new entry: %x, %x, %x\n", state->s_src_ip, state->s_dst_ip, state->s_srcdst_port);
+ }
#endif
memcpy(state->s_data, ip_hdr, tot_len);
- xmit_last= ip_hdr->protocol= state->s_indx;
+ xmit_last = ip_hdr->protocol = state->s_indx;
return PPP_TYPE_VJHC_UNCOMPR;
- }
- oip_hdr= (iphdr_t *)(state->s_data);
- otcp_hdr= (tcphdr_t *)(state->s_data + ip_hdr_len);
+ }
+ oip_hdr = (iphdr_t *)(state->s_data);
+ otcp_hdr = (tcphdr_t *)(state->s_data + ip_hdr_len);

if (*(__u16 *)&ip_hdr->version_ihl !=
*(__u16 *)&oip_hdr->version_ihl ||
@@ -388,10 +390,8 @@
return PPP_TYPE_VJHC_COMPR;
}

-DEFUN
-(void ip_vjhc_arr_uncompr, (pkt),
- pkt_ut *pkt
-)
+
+void ip_vjhc_arr_uncompr(pkt_ut *pkt)
{
rcv_state_ut *state;
iphdr_t *ip_hdr;
@@ -430,10 +430,7 @@

}

-DEFUN
-(void ip_vjhc_arr_compr, (pkt),
- pkt_ut *pkt
-)
+void ip_vjhc_arr_compr(pkt_ut *pkt)
{
iphdr_t *ip_hdr;
tcphdr_t *tcp_hdr;
diff -ruN ./elks-stuff/elksnet/screen/screen.h ./elks/elksnet/screen/screen.h
--- ./elks-stuff/elksnet/screen/screen.h 2004-05-28 16:01:55.000000000 -0400
+++ ./elks/elksnet/screen/screen.h 2004-04-20 22:11:50.000000000 -0400
@@ -28,10 +28,9 @@
PM, /* Privacy message */
};

-#define MAXSTR 128
-#define MAXARGS 64
-
-#define IOSIZE 80
+#define MAXSTR 128
+#define MAXARGS 64
+#define IOSIZE 80

struct win {
int wpid;