Yes!
Finally!
The last disk! *exhausted sigh* Oh man that took awhile ... Ok, now I get to do it all
over again! *laugher*
Well folks, as it turns out, there are a lot of you that were interested in SLS Linux.
I'm beside myself that we actually reached 250 subscribers!
With that said, it's time for an NCommander special!
For those of you who didn't see Part 1, I said I would install Softlanding Linux on
real hardware if I hit 250 subscribers.
On the surface, this seems easy enough: I’d simply have to create 31 floppy disks, and
then run the install from start to finish.
I even had a good system on hand to do this with, my ThinkPad 380D.
Of course, it nowhere near that simple.
That being said, you all have risen to the occasion, so as usual, this is your host NCommander,
and it’s time to make some floppy disks.
Taking it right from the top, I had reasons to believe SLS wouldn’t work out of the
box.
Using the factory A1 disk, my ThinkPad does indeed boot, which is an optimistic first
sign.
However, it doesn’t take too long before we see a hard disk error.
I knew older operating systems struggle with large hard disks, and SLS Linux is at the
tail end of that time period.
The fundamental cause of this is due to a design flaw in the design in the PC BIOS.
Without special handling, a PC can’t use a hard disk larger than 504 MiB.
Throughout the 90s, a technique known as “translation geometry” was used to allow DOS and other
operating systems to use disks up to 8.4 gigabytes in size.
Translation geometry is a notorious error-prone technique to get right; without working translation,
disk sizes could be misreported or an operating system would simply fail to work.
It was such a common problem that many BIOS of the era have advanced configuration settings
relating to translation.
Unfortunately, the BIOS on this ThinkPad, IBM’s EasySetup, doesn’t provide any way
to reconfigure the translation geometry or specify it by hand.
In fact, EasySetup is so limited it can be best compared to “My First BIOS” in terms
of functionality.
To solve this issue, I had to spend many hours reading through the documentation on the OSDev
Wiki to understand how an operating system talks to an ATA hard disk.
In the end, the easiest solution was to rewrite part of the Linux kernel’s hard disk driver
to use what is known as Logical Block Addressing or LBA.
By using LBA, I could completely sidestep translation issues.
I went through a lot of virtual machines and test floppies trying to get this all working.
In the end, though, I can report success!
My modified kernel is able to successfully read and write large hard disks without issue.
I thought after solving this stumbling block, I was home free.
In truth, I still had a long road ahead of me.
The next step was to put my working kernel on the A1 disk.
This ended up being a much larger headache than I had anticipated.
Taking a closer look at the A1 floppy, I found that it was formatted with a Minix filesystem.
I thought this was a bit unusual at the time, but it wasn’t hard to replace the zImage
file and run lilo to create a modified A1 disk.
The resulting A1 disk did boot, but glee quickly turned to woe as a new problem became apparent.
Instead of simply booting to a login prompt, my modified A1 disk asked me to insert a root
filesystem floppy.
If we look at how the factory A1 disk works, we see the normal kernel startup messages,
followed by this rather critical line “Loading RAMDISK …”
Under normal circumstances, Softlanding Linux loads it’s installation system into memory.
This is to allow the A1 disk to be ejected after system startup.
Without a working ramdisk, the system would simply crash if I removed A1.
Unlike later Linux kernels, ramdisks do not take the form of an initrd, or initramfs.
Instead, they’re literally a copy of a Minix filesystem in memory, as seen here in ramdisk.c.
This also explains A1’s filesystem choice.
When trying to debug unexpected behavior, it's usually easiest to start with any on-screen
messages.
In this case, I started by searching the kernel for the "Loading RAMDISK" string, and then
tracing backwards.
By doing so, we can see that the decision to load a RAMDISK is determined by the ramdisk
size parameter.
Tracing back further, we can see that ramdisk size is loaded from something called 0x1F8.
However, if we look in lilo.conf we can see that the ramdisk size is indeed set.
So what is going on here?
As it turns out, in these early versions of Linux, parameters like RAMDISK size are set
a series of bits in the zImage file itself.
We can see these if we load the file in a hex editor.
The size of the ramdisk is 16-bit integer loaded from offset 0x1F8.
This value is the number of kilobytes to load into memory.
By setting this to 1440, the size of a high destiny 3 1/2 floppy disk I was able to get
the system booting with a RAMDISK!
This behavior is documented in the manpage for the “rdev” command, which also lists
all the file offsets that have special behavior.
One thing that confused me though was how Softlanding’s original kernel works.
An examination of the stock kernel from the A1 disk shows that the ramdisk size is set
to all zeros which shouldn’t work.
It is possible that Softlanding has an undocumented modification to their kernel.
If anyone can provide further insight, I’d be happy to hear it in the comments below.
Regardless, I now had an A1 floppy which could work with larger hard disks.
Now it was time to make the other 30 disks.
I bought a 30 pack of floppy disks specifically for this video, but what came were three ten
packs.
Worse, the disk quality was a lot lower than I had hoped, with cheap plastic shutters and
flimsy shells
Still, these should work.
I’ll switch to my modern laptop so we can get a nice time lapse of making every floppy
disk.
Yes!
Finally!
The last disk! *exhausted sigh* Oh man that took awhile ... Ok, now I get to do it all
over again! *laugher* OOOOO KKKKKKKKK.
Let's get setup for that.
All I can say that was a long and tedious process, but we’re ready for installation
As we learned in part 1, Softlanding expects a DOS bootloader in the master partition record.
At the moment, Windows NT is installed on this ThinkPad so its time to format and re-install.
I have my MS-DOS 6.2 floppies ready to go.
I’ll make a 64 MiB partition so I have some wiggle room in case I still need to LOADLIN
a kernel.
With DOS installed, it was time to reboot and get the show on the road.
With the modified A1 disk, I was able to create the root and swap partitions without issue.
During Part 1, I had forgotten that it was much more common in this era to have dedicated
swap partition then use a swapfile.
After formatting, I’m prompted to remove A1 and insert A2.
Just when I think everything is going smoothly, disk I/O errors go screaming by, and I’m
forced to cancel.
What happened?
Initially, I thought there was a problem with writing the disk, so I tried to recreate it.
That however simply caused my USB floppy drive to spew I/O errors.
The disk had seemingly gone bad.
I didn’t have a lot of spare disks, and I was concerned that others might have failed.
My first thought was to reboot under DOS on the ThinkPad.
The DOS FORMAT command performs a low-level format with floppy disks, rewriting the magnetic
surface of each disk.
FORMAT completed successfully, but I had heard the disk head seek several times which is
an indication that a sector had failed.
SCANDISK also showed a long line of Bs, marking bad clusters, and chkdsk showed that 18 kilobytes
had been marked as bad sectors.
I was about to reach into the spare floppy disk box when I had a thought.
With the exception of the A1 disk, all of Softlanding Linux’s floppy disks are FAT12
formatted with normal files.
They can be read and written to under DOS without special utilities.
I decided on a hunch to simply copy the A2 files to the reformatted floppy, and re-try
the installation.
I will tell you this, folks, I was gobsmacked to see that it worked!
Hoping that had been my glitch for this project, I soldiered on …
… just to be greeted with another disk failure in the form of B7.
Just when I thought I was about to have to abort, the installation managed to continue
and prompted for B8.
From the error messages, it had simply skipped the files on the disk, and the only things
on B7 were emacs and elm, so it wasn’t a critical failure …
Slightly shaken, I kept the installation going.
Three disks from the end, X8 also decided it was going to error out.
After grinding away in futility, sysinstall gave up and asked for X9.
It, and X10 installed without issue.
I was fairly confident that despite the bad disks, I still had enough of the system installed
to actually boot.
When prompted, I configured LILO for dual-booting, and made the system boot disk.
Finally, I was prompted to reboot.
Here was the first real test to see if everything had worked.
I was elated to see the LILO prompt and Softlanding boot up on the first try.
In truth, I wasn’t expecting that!
I also confirmed that I could boot into DOS.
All I had to do was figure out what to do about B7 and X8.
On a whim, I tried running both Norton Utilities and SCANDISK on both these disks.
SCANDISK crashed with a runtime error.
Norton Utilities worked a little better, but both disks had large lines of bad clusters.
Subsequent scans showed that the disk itself was simply degrading.
In short, both disks had become hopelessly corrupt.
What’s the lesson learned here?
While some floppy disks can remain usable for decades like my original DOS disks, others
can fail in minutes.
It also isn’t hard to accidentally damage a disk as I did with A2.
I should make an important note here.
If you’re trying to recover data from a disk you care about, you should use a device
like a SuperCard Pro.
I have some vintage software I need to archive, and I’m hoping to demonstrate the SuperCard
Pro in the near future.
Never try using SCANDISK or similar utilities to try and repair dead floppies; you can make
a bad situation worse!
That interlude aside, I still had to finish installing SLS.
Fishing out two known working disks, I rewrote B7 and X8.
Afterwards, I used sysinstall to reinstall all the packages on those disks . This finally
gave me a complete install of SLS on my ThinkPad; I was able to even start X and try to play
Lander on a passive matrix display!
You might notice though the display isn’t running full size.
The LCD on this ThinkPad has a native resolution of 800x600.
As I detailed in the previous video, X needs a special driver to use anything beyond the
base VGA resolution of 640x480.
Unfortunately, this ThinkPad has a NeoMagic display chip, and not a more common Cirrus
Logic chip which I could easily adapt X for.
While X does support NeoMagic chips, both those chips and their drivers are several
years newer than the version of X that shipped with SLS.
While it may be possible to write the necessary driver, it would be a major undertaking.
The alternative: upgrading X would likely require so many changes to SLS that it would
essentially become a new distribution.
That being said, that might still be an interesting topic for another time.
In summary, with enough determination, it was in fact possible to get SLS working on
this ThinkPad.
With the rewritten ATA driver, it should work with hard disks up to 8 GiB, and it would
be relatively straightforward to go further.
I do hope this 250 subscriber special lives up to your expectations, and thank you to
all the folks that helped make this possible.
The next major milestone is 500.
I have a few ideas for what that special might be, but I’d like to hear your ideas below.
As usual, feel free to hit me up on Twitter, or come join me on Discord.
Links to the source trees are in the description.
I'd appreciate it if you'd hit that subscribe button and leave a like if you enjoyed this
video.
Until the next time, this is NCommander, signing off!
Bye-bye!