Loading Modern OS' via Compact Cassette
i just got an idea i wanna figure out how to do. i will give a fair warning, this does go into how computers load OS' in the most basic way i can explain
you know 8 bit computers like the zx spectrum (or zed ex spectrum if you're a weirdo), commodore 64/128, and apple II/II plus/IIe, and even early 5150s that didnt have floppy drives, can all load their programs from cassette tapes right? well i wanna try doing loading a linux os from cassette, which really all it would be is, installing it as normal, making a 1G boot partition (id still like to know what happened that 100M is no longer enough for boot loaders). and I was gonna say, then id have to edit the kernel in a way to get it to pause and wait for bootloader, but thats not actually how that works, the kernel does NOT call the boot loader, but instead the boot loader calls the kernel..
cause when any computer starts up (even the ARM macs), it initially starts in 8 bit mode to initialize the cpu and the BIOS, then it initializes into real mode (16 bit mode, think msdos and how that looks and feels, thats an OS running in real mode hence why its a TUI) where it then loads the rest of the board, say ram for example, via the BIOS, and once the rest of the board initializes then the BIOS looks around on typically the first drive mainly but really any drive, for a boot loader, if it finds a valid boot loader, loads that in real mode or protected mode (16 or 32 bit mode) depending on boot loader, grub for example, while stock uses the TUI for its look, actually loads the system in protected mode as it can use that mode to access the gpu for acceleration and to have higher resolutions, then the boot loader, if it sees a valid kernel or kernels, will then either just boot the kernel or allow you to choose which kernel to boot, which then, if you have a 64 bit OS installed, will initialize the system into 64 bit otherwise stays in 32 bit.
so what id have to do to get a computer to load an OS from a boot loader from tape like cassette tape programs… id basically have to write my own x86 assembly instructions for the BIOS, which may or may not require me to write and compile my own BIOS then figure out how to flash it to a pc mobo, that will hault the entire system as it listens for data from the tape, and once it listens for valid start bits (yes you need start bits to tell the system "hey, data starts here dumbass"), then continue executing code that it gets from the tape. another thing i may or may not have to do is, not only would i need to record a linux boot loader to the tape, but i may have to also record a smaller, custom written BIOS that doesnt get flashed to the board, along with some x86 assembly instructions, that sit just before the boot loader on the tape, so that it can prepare itself for a boot loader….
another issue im realizing is storage limitations, cause a compact cassette only has so much recording time, same with reel to reel, doing a little bit of math, if a tape can hold 1-2MB/minute of record time, and the most efficient tape to use would be T120s as they have the most record time available, meaning, by going with T120s id only need 5 tapes instead of a possible 20 if i go with T30s. so lets say 2MB/rm (rm = recording minutes) just to be a little generous, if we multiply 2MB/rm * 120rm (60rm/side) = 240MB = 120MB/side. now that we have the amount of data per tape, we now need to calculate how many tapes we need, by how much space boot loaders now need which as i mentioned earlier they now require 1GB, thatll be 1024MB/T120 = 8.53333333333 cassettes, or more simply 8½ T120 tapes.
which in the 80s when programs were much smaller but still did a fuck ton of work for what was needed, this amount of tapes for software woulda been absurd, but would make sense for a floppy disk, floppy disks were only 360k-720k so you woulda needed 5 floppys for one program compared to only needing one cassette for the same program, so in the 80s the cassette tape had the advantage of storage capacity, but was slower as you had to let the tape run through linearly, floppy had the advantage of seeking sectors non linearly giving them faster load times.
my only other thing aside from all this, how would i convert a boot partiton and its filesystem to a raw data stream to record to tape.
but, i think realistically what i should do to see if loading programs from tape on modern system can still be done, is to start smaller with writing a command line utility or desktop program that has to be loaded from tape. and if i have to start it smaller in a way where the initial executing code would still be on the machine via a double click of an executable, then have that load some code in ram to listen for incoming data to load the rest of the program, then so be it. drawing the window and its borders and all that would be on the tape, the only thing the initial executable is doing is loading a listener into ram to listen for the data… which now that i think about it, is actually kind of like how the 80s machines do it, where they start listening for program data when a you type and run the command load, or load deskmate if the specific program on the tape has a label that it goes by.
and while labels on 80s computers are the gold standard, on a modern system like what im typing this all out on, is more prone to exploiting that kinda thing, so instead what im gonna be opting to use is obfuscated sha-256 checksums, so say an executable has a decoder for 4567 checksum, but instead i pop in a tape that has 891011 for its checksum, the idea is, itll listen for 4567, receive a set of checksum bits, 891011, compare it to what it expects, sees its the wrong bits, throws a pop up window saying something like "program not found" and kill the listener process, and when the 4567 checksum does receive its expected 4567 bits, then load as normal