Updated Linux tools for working with 3B1 emulator disk images

100 views
Skip to first unread message

Aharon Robbins

unread,
Dec 10, 2020, 2:30:32 PM12/10/20
to
Hello All.

If you're using the "freebee" 3B1 emulator, this may be of interest to you.

In https://github.com/arnoldrobbins/s4-3b1-pc7300/ is an updated "sysv"
file system module that should work with modern Linux systems. Also
included are tools for exporting a file system image from a hard disk
image and for importing a file system image back into a hard disk image.

The only credit I take here is getting the sysv module to work on
Ubuntu 18.04 (which is the system I have).

I've updated the main README.md and added sysv/README.md which explains
(briefly) how to compile and use the kernel module with file system
images.

Enjoy,
--
Aharon (Arnold) Robbins arnold AT skeeve DOT com

David Gesswein

unread,
Jan 8, 2021, 7:36:21 PM1/8/21
to
In article <rqtt0l$1537$1...@gioia.aioe.org>,
Aharon Robbins <arn...@skeeve.com> wrote:
>Hello All.
>
>If you're using the "freebee" 3B1 emulator, this may be of interest to you.
>
>In https://github.com/arnoldrobbins/s4-3b1-pc7300/ is an updated "sysv"
>file system module that should work with modern Linux systems. Also
>included are tools for exporting a file system image from a hard disk
>image and for importing a file system image back into a hard disk image.
>
I see you started with my fixes.

I did see this issue with your updated kernel module that I reported
against the original repo?
https://github.com/dad4x/s4-3b1-pc7300/issues/3

Do you know if this requires 5.4 kernel or will work on older? I tend to
not update that often.

Aharon Robbins

unread,
Jan 9, 2021, 4:01:43 PM1/9/21
to
In article <i5sc44...@mid.individual.net>,
David Gesswein <d...@pdp8online.com> wrote:
>In article <rqtt0l$1537$1...@gioia.aioe.org>,
>Aharon Robbins <arn...@skeeve.com> wrote:
>>Hello All.
>>
>>If you're using the "freebee" 3B1 emulator, this may be of interest to you.
>>
>>In https://github.com/arnoldrobbins/s4-3b1-pc7300/ is an updated "sysv"
>>file system module that should work with modern Linux systems. Also
>>included are tools for exporting a file system image from a hard disk
>>image and for importing a file system image back into a hard disk image.
>>
>I see you started with my fixes.

Yes, I was pointed at your repo.

>I did see this issue with your updated kernel module that I reported
>against the original repo?
>https://github.com/dad4x/s4-3b1-pc7300/issues/3

This remains true. I don't know why. Running s4fsck on the extracted
filesystem before mounting it fixes things so that Linux is happy.
Unix then runs fsck on the filesystem when it's imported back. This
seems to work, but there may be some problems with it. This whole thing
should be investigated but I don't have the cycles.

>Do you know if this requires 5.4 kernel or will work on older? I tend to
>not update that often.

I did the fix against 4.15.0 kernel sources, and it works fine on kernel
5.4.0 (both Ubuntu 18.04).

Hope this helps,

Arnold

Peter Schmidt

unread,
Jan 9, 2021, 5:37:42 PM1/9/21
to
It seems ustat.h was removed when a new glib came out, in Ubuntu 18.10 and similar. I can't build it out fo the box now, any suggestions?

Peter Schmidt

unread,
Jan 9, 2021, 5:48:55 PM1/9/21
to
* glibc, curse you autocorrect!

Aharon Robbins

unread,
Jan 11, 2021, 1:13:10 AM1/11/21
to
In article <cc9b9093-2116-438e...@googlegroups.com>,
Peter Schmidt <pe...@transcend.aero> wrote:
>It seems ustat.h was removed when a new glibc came out, in Ubuntu 18.10
>and similar. I can't build it out fo the box now, any suggestions?

Replacing it with statfs should do the trick. It looks like an
easy fix.

Please open an issue on GitHub and I'll get to it.

Thanks,

Peter Schmidt

unread,
Jan 11, 2021, 10:20:41 AM1/11/21
to
Will do, and thanks!

Peter Schmidt

unread,
Jan 11, 2021, 8:19:43 PM1/11/21
to
Err, sorry, but I'm not seeing the issues tab on https://github.com/arnoldrobbins/s4-3b1-pc7300 - am I dense or are they currently disabled?

David Gesswein

unread,
Jan 11, 2021, 9:34:39 PM1/11/21
to
In article <187e1e2b-3991-4b97...@googlegroups.com>,
Peter Schmidt <pe...@transcend.aero> wrote:
>Err, sorry, but I'm not seeing the issues tab on
>https://github.com/arnoldrobbins/s4-3b1-pc7300 - am I dense or are they
>currently disabled?
>
By default disabled on a fork. Can be enabled.
https://softwareengineering.stackexchange.com/questions/179468/forking-a-repo-on-github-but-allowing-new-issues-on-the-fork

Aharon Robbins

unread,
Jan 11, 2021, 10:52:05 PM1/11/21
to
Harumph. Seems they have to be manually enabled. Done. Sorry
about that.

In article <187e1e2b-3991-4b97...@googlegroups.com>,

Peter Schmidt

unread,
Jan 12, 2021, 8:06:33 AM1/12/21
to
Issue opened, cheers!

On Monday, January 11, 2021 at 10:52:05 PM UTC-5, Aharon Robbins wrote:
> Harumph. Seems they have to be manually enabled. Done. Sorry
> about that.
>
> In article <187e1e2b-3991-4b97...@googlegroups.com>,
> Peter Schmidt <pe...@transcend.aero> wrote:
> >Err, sorry, but I'm not seeing the issues tab on
> >https://github.com/arnoldrobbins/s4-3b1-pc7300 - am I dense or are they
> >currently disabled?
> >
> >On Monday, January 11, 2021 at 10:20:41 AM UTC-5, Peter Schmidt wrote:
> >> Will do, and thanks!
> >> On Monday, January 11, 2021 at 1:13:10 AM UTC-5, Aharon Robbins wrote:
> >> > In article <cc9b9093-2116-438e...@googlegroups.com>,
> >> > Peter Schmidt <pe...@transcend.aero> wrote:
> >> > >It seems ustat.h was removed when a new glibc came out, in Ubuntu 18.10
> >> > >and similar. I can't build it out of the box now, any suggestions?

Aharon Robbins

unread,
Jan 13, 2021, 4:56:20 AM1/13/21
to
OK, I have fixed this thoroughly. The original code checked if
a block device was mounted using ustat. It did not check if a file
system image was mounted.

I have fixed both things by writing some new code and adding an
additional check. Note that the code is Linux-specific. It's all
pushed to the repo and the issue is closed.

Please try it out.

Arnold

In article <14ec6db8-0a28-415c...@googlegroups.com>,

Peter Schmidt

unread,
Jan 13, 2021, 12:01:18 PM1/13/21
to
Arnold that is great!

Now, perhaps this is user error, but when I run s4export on my freebee hd.img, it fails with "badmagic," though s4disk appears to parse it fine. I opened another issue on that with output, in case that's helpful. Any advice?

Aharon Robbins

unread,
Jan 13, 2021, 1:06:02 PM1/13/21
to
In article <6870aa07-69a7-4603...@googlegroups.com>,
Peter Schmidt <pe...@transcend.aero> wrote:
>Arnold that is great!
>
>Now, perhaps this is user error, but when I run s4export on my freebee
>hd.img, it fails with "badmagic," though s4disk appears to parse it
>fine. I opened another issue on that with output, in case that's
>helpful. Any advice?

No advice, sorry. The s4export and s4import have worked fine
for me, without any problems.

As I've noted, there is an impedance mismatch between Unix and Linux
with respect to the free list. You have to s4fsck the exported fs
before mounting it.

I don't have the cycles right now to investigate your issue. To be
honest, I don't know when I will, either.

Hmmm. I notice that you're on a Raspberry Pi. Can you try it on
an Intel Linux system? Preferably x86_64.

If it works on an Intel system, then there's likely an issue relating
to sizeof(int) and sizeof(long) on the RPi, and maybe also related
to big endian vs. little endian.

HTH,

Peter Schmidt

unread,
Jan 14, 2021, 7:32:15 AM1/14/21
to
OK, will try on an Intel box and report back for thread completeness.

J Booth

unread,
Jan 16, 2021, 10:27:51 PM1/16/21
to
Hi Peter - I don't think this is 32-bit vs 64-bit related as I didn't see any offending long's in the s4 code. I do think there may be an issue with 17sec/tk, I need to look into further, as I had a similar bagmagic issue with 17sec/tk, but not with my 16sec/tk image.

Jesse

David Gesswein

unread,
Jan 17, 2021, 7:58:56 AM1/17/21
to
In article <e5eb6111-9fe3-49dd...@googlegroups.com>,
Peter Schmidt <pe...@transcend.aero> wrote:
>OK, will try on an Intel box and report back for thread completeness.
>

You can also try this image and see if it works where its failing for you.
https://www.pdp8online.com/3b1/3b1-hd.zip

If it doesn't fail would need to get your failing image to see what is going
on.

Peter Schmidt

unread,
Jan 17, 2021, 9:17:01 AM1/17/21
to
David, your image worked fine with s4export, thanks! The one that is failing is here: https://drive.google.com/file/d/1dCGTfNSjuX3VM-cJAV7f3euSD9ggDaci/view?usp=sharing

Working on building the sysv driver now...

Peter Schmidt

unread,
Jan 17, 2021, 9:18:57 AM1/17/21
to
On Saturday, January 16, 2021 at 10:27:51 PM UTC-5, J Booth wrote:
> Hi Peter - I don't think this is 32-bit vs 64-bit related as I didn't see any offending long's in the s4 code. I do think there may be an issue with 17sec/tk, I need to look into further, as I had a similar bagmagic issue with 17sec/tk, but not with my 16sec/tk image.
>
> Jesse

Jesse, thanks for the reply, if you have a minute, curious if the image I shared in my reply to David has the same issue. I built it generically with the freebee instructions.

David Gesswein

unread,
Jan 17, 2021, 12:31:28 PM1/17/21
to
Peter Schmidt <pe...@transcend.aero> wrote:
>David, your image worked fine with s4export, thanks! The one that is
>failing is here:
>https://drive.google.com/file/d/1dCGTfNSjuX3VM-cJAV7f3euSD9ggDaci/view?usp=sharing
>


I tried to boot your image under my FreeBee and it doesn't boot. Does
it boot fine on your machine? Does my image boot under your FreeBee?
I don't get the loader screen at all.

I wonder if this is FreeBee isn't creating the image properly on your
platform.

In article <e11f59d8-d78e-467e...@googlegroups.com>,

J Booth

unread,
Jan 17, 2021, 12:58:48 PM1/17/21
to
Peter, I checked out your file. Your hd.img is sized to 1024*8*16*512, but the header info in the hd.img is stating 1024*8*17*512, so this is probably what's causing the issue. The instructions for creating the hd.img recently changed -- they previously were 'dd if=/dev/zero of=hd.img bs=512 count=$(expr 16 \* 8 \* 1024)' but that recently was updated to make a file image with 17sec/tk instead of 16sec/tk. ('dd if=/dev/zero of=hd.img bs=512 count=$(expr 17 \* 8 \* 1024)') Or alternatively you can use the makehdimg tool that Arnold recently added. (The 3b1 - AFAIK - only uses the 17th sector in the case of a bad block which won't occur in emulation. But using 17sec/tk is what the OS seems to want.) Another recent change was to use the cylinder/head/sector from the hd.img when loading the hd.img into FreeBee to allow for different sized drives. Originally it was just hard coded to use 16sec/tk and 8 heads and the cylinder count was detected by the size of the hd.img. But recently support was added for HD's using up to 16 heads. So we just grab that data from the hd.img now.

Peter Schmidt

unread,
Jan 17, 2021, 4:22:31 PM1/17/21
to
Yours boots on mine, but the one I uploaded does not. Looks like I screwed up and not only uploaded a corrupted one - possibly from an earlier version of freebee - but accidentally overwrote the one I had been booting, d'oh. If it would be of interest, I can make a new one as I did before, let me know. But given yours is working on mine, seems likely it was a version skew.

Peter Schmidt

unread,
Jan 17, 2021, 4:23:24 PM1/17/21
to
On Sunday, January 17, 2021 at 12:58:48 PM UTC-5, J Booth wrote:
> Peter, I checked out your file. Your hd.img is sized to 1024*8*16*512, but the header info in the hd.img is stating 1024*8*17*512, so this is probably what's causing the issue. The instructions for creating the hd.img recently changed -- they previously were 'dd if=/dev/zero of=hd.img bs=512 count=$(expr 16 \* 8 \* 1024)' but that recently was updated to make a file image with 17sec/tk instead of 16sec/tk. ('dd if=/dev/zero of=hd.img bs=512 count=$(expr 17 \* 8 \* 1024)') Or alternatively you can use the makehdimg tool that Arnold recently added. (The 3b1 - AFAIK - only uses the 17th sector in the case of a bad block which won't occur in emulation. But using 17sec/tk is what the OS seems to want.) Another recent change was to use the cylinder/head/sector from the hd.img when loading the hd.img into FreeBee to allow for different sized drives. Originally it was just hard coded to use 16sec/tk and 8 heads and the cylinder count was detected by the size of the hd.img. But recently support was added for HD's using up to 16 heads. So we just grab that data from the hd.img now.

Great to know - thanks!

David Gesswein

unread,
Jan 18, 2021, 7:43:00 AM1/18/21
to
In article <32e5bb01-8e6e-4dac...@googlegroups.com>,
Peter Schmidt <pe...@transcend.aero> wrote:
>
>Yours boots on mine, but the one I uploaded does not. Looks like I
>screwed up and not only uploaded a corrupted one - possibly from an
>earlier version of freebee - but accidentally overwrote the one I had
>been booting, d'oh. If it would be of interest, I can make a new one as
>I did before, let me know. But given yours is working on mine, seems
>likely it was a version skew.


From the other post it sounds like it should work fine if you use the current
code and procedure. I don't need you to try to make a new image. If you do
run into further issues I can take a look.

J Booth

unread,
Jan 20, 2021, 1:55:58 PM1/20/21
to
The latest version of the s4 tools are available at David Gesswein's github:
https://github.com/dgesswein/s4-3b1-pc7300

This includes the updates and instructions that Arnold made for getting things compiling on recent Linux. I found this very helpful - it wasn't too bad to get things compiled, the kernel module loaded, and a fs image exported and mounted under linux. This is quite helpful for getting software loaded into the FreeBee emulator.

I found the problem with the free list being incorrect, so you shouldn't need to fsck an exported and imported file system anymore. If you run into any issues, please open an Issue on David's github.

Jesse
Reply all
Reply to author
Forward
0 new messages