Yahoo Groups archive

Emax

Index last updated: 2026-04-28 23:23 UTC

Thread

How to write Emax II OS disks with Linux

How to write Emax II OS disks with Linux

2004-01-31 by poeml@...

Hi, 

I looked at the EMX source code, and figured out that writing these OS
floppies is pretty straightforward with the Linux OS. It works like
this:

- raw format an 800K floppy:
  fdformat /dev/fd0u800

- given you have the emaxos.emx file available, as it can be found in
  the files section of this group, it can be written with the dd(1)
  tool. Since the layout of parts of the OS is a bit complicated, I used
  the following shell script:

---snip------------>
#!/bin/bash

osfile=emaxos.emx
drive=/dev/fd0u800

set -x

# OS is layed out on disk in the following blocks:
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# (total blocks on disk: 1600, numbered 0 to 1599)
#
# OS               0 to  367            n= 368
# Bank           368 to  423            n=  56
# OS             424 to  439            n=  16
# Samples        440 to 1463            n=1024
# OS            1464 to 1599            n= 136
#

function WriteOS () {
        local out=$1
        # here, we read from stdin, but divide the stream in three parts, as in:
        # (dd of=bla count=1; dd of=bla count=1 seek=1; dd of=bla seek=2) < emaxos.emx
        dd bs=512 count=368     | dd of=$out bs=512
        dd bs=512 count=16      | dd of=$out bs=512 seek=424
        dd bs=512 count=136     | dd of=$out bs=512 seek=1464
}

function ReadOS () {
        local in=$1
        dd if=$in bs=512 count=368
        dd if=$in bs=512 count=16 skip=424
        dd if=$in bs=512 count=136 skip=1464
}


md5sum $osfile
WriteOS $drive < $osfile
rm -f $osfile.read
ReadOS $drive > $osfile.read    # verify it...
md5sum $osfile.read
exit 0
<---snap----------


The script is in a bit rough form but I thought I'd already share it
nevertheless.

Credits go to Mike Prudence, author of EMX, of which the source code
enlightened me. 

So far I have only formatted OS disks, I haven't looked into copying
banks, but that will be the next thing.

Peter
PS. It would be possible to make a Mini-Linux one-floppy-distribution
that contains the needed tools (mostly fdformat and dd), so one could
boot from that floppy -- that'd be easier to get hold of that painful
DOS...


[Non-text portions of this message have been removed]

Re: [emax] How to write Emax II OS disks with Linux

2004-01-31 by poeml@...

Sorry about the self-followup, but I remembered that I forgot something.

On Sat, Jan 31, 2004 at 10:04:31PM +0100, Oernvi wrote:
> - given you have the emaxos.emx file available, as it can be found in
>   the files section of this group, it can be written with the dd(1)
>   tool. Since the layout of parts of the OS is a bit complicated, I used
>   the following shell script:

I could add the following detail: the layout is a bit complicated since
the OS is devided in three parts and located on three different regions
of the disk. Technically it is not necessary to write those three parts,
it works just as well to capture an entire disk image via

	dd if=/dev/fd0u800 of=emaxos.emx

Then, anyone can re-create such a disk with

	dd if=emaxos.emx of=/dev/fd0u800

The advantage is that the dedicated shell script is not necessary. The
disadvantage is that the resulting file is larger (well, 800 Kilobyte
:). It compresses quite well, though, to about 150 KB.

It would also possible to store the data in a file with holes in it, but
that'd be less portable to other operating systems.

I'm curious about exploring reading and writing banks, because I really
hate typing file names in EMX under DOS blindly... hope I can share good
news soon :-)

Peter

PS. Formatting fresh disks with 'fdformat /dev/fd0u800' might still be
necessary, and is a Good Thing because it will verify the disk.


[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.