Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mknbi-dos problems (MS-DOS 5)




Hi there,

while trying to get my pbx (486/66 4MB) netbooting, I ran into 
some problems, which showed up as follows:

First handish try with mtools succeeded, but had some trouble 
with the dos drivers. While fiddling around with the stuff, I 
damaged the mtools diskimage: emm386.exe & command.com not found 
(any more), but were visible & accessible thru mtools :-(

mtools --version:
Mtools version 3.9.6, dated 28 June 1999
configured with the following options: enable-xdf disable-vold 
disable-new-vold disable-debug enable-raw-term 

In order to get get a proper build environment, I prepared this script:

---8<---
#! /bin/bash
#
# create a netbootable dos image
#
# (c)2000 by H.P.Jansen, LISA GmbH, Berlin
#
bootimg=${TEMP:-/tmp}/pbxboot.img
bootimglabel=netboot-hp
bootdst=/djini/tftpboot/pbx.nb
bootdir=$HOME/backup/pbxboot
bootsec=$bootdir/bootsec.fd
sysfiles="/io.sys /msdos.sys"   # gets copied first && attrib +rsh'ed
addfiles="/command.com /config.sys /autoexec.bat" # get copied next
mtoolsrc=~/.mtoolsrc.tmp
drv=z:

function eecho {
    echo -e "$*" >&2
}

function fatal {
    [ -n "$1" ] && echo -e "$0: $1" >&2 && shift
    exit $1
}

mcopy > /dev/null 2>&1
[ "$?" -eq 127 ] && fatal "mtools package not installed! Go for it..." 1

mknbi-dos > /dev/null 2>&1
[ "$?" -eq 127 ] && fatal "netboot package not installed! Go for it..." 1

[ -d $bootdir ] || fatal "host bootdir $bootdir missing" 1
[ -s $bootsec ] || fatal "boot sector $bootsec missing" 1
for i in $sysfiles $addfiles; do
    [ -s $bootdir/$i ] || fatal "system file $i missing" 1
done

cat > $mtoolsrc << EOF
drive $drv file="$bootimg"
EOF
export MTOOLSRC=$mtoolsrc

eecho "Create $bootimg on $drv"
rm -rf $bootimg
#mformat -t 80 -s 18 -h 2 -B $bootdir/bootsec.fd -C -l $bootimglabel $drv ||\ 
#   fatal "mformat $drv ($bootimg) failed" 2
mformat -t 80 -s 9 -h 2 -B $bootdir/bootsec.fd -C -l $bootimglabel $drv ||\ 
    fatal "mformat $drv ($bootimg) failed" 2

for i in $sysfiles; do
    eecho "copy $bootdir$i -> $drv$i"
    mcopy -mnp "$bootdir$i" "$drv$i" || fatal "mcopy failed" 2
    eecho "attrib +rsh $drv$i"
    mattrib +rsh "$drv$i" || fatal "mattrib failed" 2
done

for i in $addfiles; do
    eecho "copy $bootdir$i -> $drv$i"
    mcopy -mnp "$bootdir$i" "$drv$i" || fatal "mcopy failed" 2
done

for i in `find $bootdir -type d -print`; do
    d="${i/$bootdir}"
    if [ -n "$d" ]; then
        eecho "mkdir $drv$d"
        mmd $drv$d || fatal "mdir $drv$d failed" 2
    fi
done

for i in `find $bootdir -type f -print`; do
    for x in $sysfiles $addfiles; do
        if [ "$x" == "${i##$bootdir}" ]; then
            continue 2;
        fi
    done
    f=$drv${i/$bootdir}
    eecho "copy $i -> $f"
    mcopy -mnp "$i" "$f" || fatal "mcopy failed" 2
done

mknbi-dos -x -x -s 720 -r $bootimg -o $bootdst

--->8---

which should do the trick properly (although is lacks
commandline parameters, some more error checkings and
tweaks mtools config for this session (intended!)...)

This is a sample run:

Create /var/tmp/pbxboot.img on z:
copy /home/hp/backup/pbxboot/io.sys -> z:/io.sys
attrib +rsh z:/io.sys
copy /home/hp/backup/pbxboot/msdos.sys -> z:/msdos.sys
attrib +rsh z:/msdos.sys
copy /home/hp/backup/pbxboot/command.com -> z:/command.com
copy /home/hp/backup/pbxboot/config.sys -> z:/config.sys
copy /home/hp/backup/pbxboot/autoexec.bat -> z:/autoexec.bat
mkdir z:/sys
copy /home/hp/backup/pbxboot/bootsec.fd -> z:/bootsec.fd
copy /home/hp/backup/pbxboot/sys/debug.exe -> z:/sys/debug.exe
copy /home/hp/backup/pbxboot/sys/doskey.com -> z:/sys/doskey.com
copy /home/hp/backup/pbxboot/sys/emm386.exe -> z:/sys/emm386.exe
copy /home/hp/backup/pbxboot/sys/himem.sys -> z:/sys/himem.sys
copy /home/hp/backup/pbxboot/sys/keyb.com -> z:/sys/keyb.com
copy /home/hp/backup/pbxboot/sys/keyboard.sys -> z:/sys/keyboard.sys
copy /home/hp/backup/pbxboot/sys/mem.exe -> z:/sys/mem.exe
copy /home/hp/backup/pbxboot/sys/mode.com -> z:/sys/mode.com
copy /home/hp/backup/pbxboot/sys/more.com -> z:/sys/more.com
copy /home/hp/backup/pbxboot/sys/bioncl.exe -> z:/sys/bioncl.exe
copy /home/hp/backup/pbxboot/sys/login.exe -> z:/sys/login.exe
copy /home/hp/backup/pbxboot/sys/edit.exe -> z:/sys/edit.exe
copy /home/hp/backup/pbxboot/sys/3c5x9pd.com -> z:/sys/3c5x9pd.com
Ramdisk filename = /var/tmp/pbxboot.img
Output file name = /djini/tftpboot/pbx.nb

Load record information:
  Magic number:     0x1B031336
  Length of header: 16 bytes (standard) + 16 bytes (vendor)
  Flags:            0x00000000
  Location address: 1000:0000
  Execute address:  1040:0000
  Vendor data:      GK-mknbi-DOS

Record #1:
  Length of header: 16 bytes (standard) + 0 bytes (vendor)
  Vendor tag:       0x10 (primary boot loader)
  Reserved flags:   0x00
  Flags:            0x00 (absolute address)
  Load address:     0x00010400
  Image length:     0x00000E00 bytes
  Memory length:    0x0000FC00 bytes
  Vendor data:      none

Record #2:
  Length of header: 16 bytes (standard) + 8 bytes (vendor)
  Vendor tag:       0x11 (ramdisk image)
  Reserved flags:   0x00
  Flags:            0x04 (absolute address, last record)
  Load address:     0x00110000 (high memory)
  Image length:     0x0008DC00 bytes
  Memory length:    0x000B4000 bytes
  Vendor data:      80 cylinders; 2 heads; 9 sectors; disk id: 0x00

Everything is looking fine. The resulting image gets 
loaded, but after Gero's loader, the system complains:

Kein System oder Laufwerksfehler
Wechseln und Taste drücken

(No system or drive failure)
(Insert disk and press key)

This message comes from the original M$DOS 5.0 bootsector code,
but why the hell, it can't access the ramdisk?

I reproduced this effect with mknbi-dos out of etherboot 4.4.2 
(netboot 0.81) and netboot 0.9e. May be, it's mtools related?
From 0.9e the mknbi-mgl build seems to be broken, btw (Gero!):
gcc -O3 -mpentiumpro -O2 -Wall  -DHAVE_CONFIG_H -I. -I.. -I../include -DPARANOID   -c y.tab.c -o
y.tab.o
mglparse.y: In function `yyparse':
mglparse.y:2388: called object is not a function
mglparse.y:2388: called object is not a function
mglparse.y:2388: warning: left-hand operand of comma expression has no effect
mglparse.y:2388: warning: left-hand operand of comma expression has no effect
mglparse.y:2388: called object is not a function
mglparse.y:2388: warning: left-hand operand of comma expression has no effect
mglparse.y:2388: called object is not a function
mglparse.y:2388: warning: left-hand operand of comma expression has no effect
mglparse.y:2414: called object is not a function
mglparse.y:2414: called object is not a function
mglparse.y:2414: warning: left-hand operand of comma expression has no effect
mglparse.y:2414: warning: left-hand operand of comma expression has no effect
mglparse.y:2414: called object is not a function
mglparse.y:2414: warning: left-hand operand of comma expression has no effect
mglparse.y:2414: called object is not a function
mglparse.y:2414: warning: left-hand operand of comma expression has no effect
mglparse.y:2388: warning: `__s2_len' might be used uninitialized in this function

but mknbi-dos builds fine. This is a directory listing directly
from the broken boot image:

 Volume in drive Y is NETBOOT-HP 
 Volume Serial Number is 4A26-B9E4
Directory for Y:/

io       sys     41055 05-31-1994   6:22 
msdos    sys     38186 05-31-1994   6:22 
command  com     57377 05-31-1994   6:22 
config   sys       194 02-12-2000   5:16 
autoexec bat       175 02-11-2000  22:14 
sys          <DIR>     02-12-2000   6:10 
bootsec  fd        512 02-09-2000  17:23 
        7 files             137 499 bytes

Directory for Y:/sys

.            <DIR>     02-12-2000   6:10 
..           <DIR>     02-12-2000   6:10 
debug    exe     15945 05-31-1994   6:22 
doskey   com      5991 05-31-1994   6:22 
emm386   exe    121950 05-31-1994   6:22 
himem    sys     29408 05-31-1994   6:22 
keyb     com     15871 05-31-1994   6:22 
keyboard sys     34607 05-31-1994   6:22 
mem      exe     33030 05-31-1994   6:22 
mode     com     24097 05-31-1994   6:22 
more     com      2567 05-31-1994   6:22 
bioncl   exe     53976 02-11-2000  18:35 
login    exe     10084 02-11-2000  18:25 
edit     exe     64344 07-27-1993  18:03 
3c5x9pd  com     12352 06-18-1993  11:39 
       15 files             424 222 bytes

Total files listed:
       22 files             561 721 bytes
                            156 672 bytes free

Everything is in place, but it doesn't work.

Ask for missing details.

Any hints and ideas are welcome.

Thanks for listening

Hans-Peter
===========================================================================
This Mail was sent to netboot mailing list by:
hpj.lisa@t-online.de (Hans-Peter Jansen)
To get help about this list, send a mail with 'help' as the only string in
it's body to majordomo@baghira.han.de. If you have problems with this list,
send a mail to netboot-owner@baghira.han.de.



For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.