                NC MSD Autorun Features

There are two requirements to make NC card behave like autorun disk(like CD).

(1) Switch usb to MSD(mass storage Disk) mode. 
    Refer to pkg.c as an example to switch to MSD. For a quick try, just build 
pkg.wad, import it, then launch it with viewer as regular game.

(2) Build disk image file and put it on NC card as /sys/setup.msd 
    To create this image file, you need to have MBR(master boot record) and
FAT filesystem, and concatenate them as a single file.

    The typical MBR is checked in at disk folder. But partition table need 
to modified if disk size is not 1MBytes.

    Create FAT filesystem via any tools.

    Here is an example:

    (a) create 1 Mbytes file system
        dd if=/dev/zero of=mbr bs=512 count=1
        dd if=/dev/zero of=fs bs=1024 count=1024

        /sbin/mkdosfs -F 12 -n "iQue setup disk" fs
        mount -o loop fs /home/whs/sc/msd/fat

    (b) Add autorun files.
        cp downloadPc.exe fat
        cp autorun.inf fat
        umount /home/whs/sc/msd/fat

    (c) use hex edit to create partition table
        (i) From offset 0x1Be (16 Bytes)
            80 -- Active 80
            01 -- Begin header
            01 00 -- Start sector = 01 (little endia short bits 5-0)
                 cylinder = 0 (little endian {[bits 7-6] [bit 15-8])
            04 -- FAT12
            03 -- End header
            20 10 -- End sector = 20 cylinder = 10
            01 00 00 00 -- offset
            00 08 00 00 -- size 0x800 = (x512 = 1MBytes)
        (ii) Last two bytes 55 AA
   
    (d) create final disk image
        cat mbr fs > setup.msd
