Loading programs from casette tape

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Loading programs from casette tape

Post by Geri »

I decided to later add a method to the operating system, what can transfer files in and out through a general jack connector.

such as like loading and executing programs played from a casette tape.
this practice was actively used in the 80s and early 90s, but later supressed by floppy, hdd, network cards, and pendrives.

i decided to add this method to have a timeless and cheap method of transfering data from/to dawn-os computers of the future, as we cant forsee types of disk interfaces will come, and so maybe if someone manufactures an sd card slot as the disk drive, but maybe after 5 years around we will use different connectors, and there will be no sd cards available, so who knows?

i didnt really found much informations about this topic, so i would like to ask about the oppinions of these:

-should i even use binary representation aniway, or should i try 3 bit or 4 bit?

-what is the ideal and safe encoding for a bit? i tought S(-s)S(-s)00 for 1 and 000S00 for 0. (basically a short WIII and a shrort P as its easy to detect it)

-what is the safe signal rate of a typical casette? obviously i should discard stereo, and only store mono signal. they say a casette is probably able to store up to 22 khz, which wouuld mean a theocretical 22 kilosignal per second, but in practice this is of course a bullshit. commodore, msx and soviet computers used much lower signal rate, probably around 50-300 byte/sec, which is around a maximum of 1200 signal per second. does this is a safe limit? in this case, however, i cant do this protocol, as a relatively complex game is typically 2-3 mbyte long, and thjat would mean 3 hour loading time, and one side of the casette is just 26 minute long aniway :D
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
ronsor
Member
Member
Posts: 27
Joined: Wed Jan 25, 2017 5:31 pm
Libera.chat IRC: Ronsor

Re: Loading programs from casette tape

Post by ronsor »

That is going to be slow and awful, not much storage space too.

I suggest you look at https://en.m.wikipedia.org/wiki/Kansas_City_standard
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Loading programs from casette tape

Post by Geri »

A '0' bit is represented as four cycles of a 1200 Hz sine wave, and a '1' bit as eight cycles of 2400 Hz. This gives a data rate of 300 baud. E
hmm interesting, i beleive that kind of signal detection (as it irequires frequency analization) either needs hardware acceleration, or an ugly software analyzis while the signal rate is still low, and chance of bugs are quite high. the 300 baud they achieved there is 10x slower than the capability of commodore 64 casette processing, this makes this data protocol flawed. no wonder they didnt agreed to use it.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Loading programs from casette tape

Post by iansjack »

Geri wrote:this practice was actively used in the 80s and early 90s, but later supressed by floppy, hdd, network cards, and pendrives.
There's a good reason that it was superseded.

Abysmal data-transfer rate.
Poor long-term stability of medium.
Extremely poor reliability with ultra-sensitivity to variations in hardware/media.

Reverting to 30-year old technology is a bad idea for a present-day OS. Even proper data-quality tape drives have disappeared for all but specialist applications. Using a fragile, cobbled-together audio format for data storage is not a good idea.
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Loadin iansjack Post subject: g programs from casette

Post by Geri »

iansjack wrote:Using a fragile, cobbled-together audio format for data storage is not a good idea.
cd and dvd also uses this format (pit + lands)
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
Peterbjornx
Member
Member
Posts: 116
Joined: Thu May 06, 2010 4:34 am
Libera.chat IRC: peterbjornx
Location: Leiden, The Netherlands
Contact:

Re: Loading programs from casette tape

Post by Peterbjornx »

That encoding is quite easy to decode: use FFT on small segments of the signal or apply a bandpass filter at the frequencies specified, although I would recommend Manchester coding instead of using the analog signal for timing
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Loading programs from cassette

Post by iansjack »

Geri wrote:
iansjack wrote:Using a fragile, cobbled-together audio format for data storage is not a good idea.
cd and dvd also uses this format (pit + lands)
CDs and DVDs are digital media. Audio cassette is analog. There's no comparison; the encoding methods are completely different. You need to look at DAT rather than audio cassette (and DAT tapes are fragile enough).
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Loading programs from casette tape

Post by Schol-R-LEA »

I probably should keep out of this, given who is at fault for this topic coming up, but you need to consider that cassette hardware is growing harder to come by as well - while cassettes and cassette players are still manufactured, they are made in tiny quantities today compared to either media such as SD cards, or to the volumes in which they were sold in their heyday of the late 1970s and early to mid-1980s.

A new cassette tape would probably cost only slightly less that a 4GB USB flash drive (about $6 US where I am living) - keeping in mind that (in the US at least) a number of companies give flash drives of sizes up to 4GB away for free when passing around samples of whatever they happen to be promoting.

For example, compare this Maxell normal bias 90-minute cassette 3 pack, currently priced $7 US on Amazon (unit price $2.33), to this Verbatim 4GB USB flash drive 3 pack for a little over $16 (unit price $5.40 US). While the USB drive is more than twice the price, that's mostly because of the USB circuitry - the cost of the NAND Flash data storage components is only a tiny fraction of the price, which is why the prices for 256MB, 1GB, and 4GB drives are almost identical. For that money, you get over 6000 times as much data storage, at vastly higher transfer rates.

Now, according to Wicked-Pedo, the Commodore 1530 Datasette ran at the same 300 baud as the original version of the Kansas City standard; AFAICT, the relatively few cassette formats (e.g., Acorn CUTS) which worked faster with standard cassettes still maxed out at only 1200 baud. In a USB drive, 1200 bits per second would be considered within normal performance variance (i.e., negligible).

Regarding capacity, a 90-minute tape could, with the most efficient encodings used, record 660KiB of non-compressed data, though if you absolutely intend to update this idea, I suppose it wouldn't be too hard to add Run-Length Encoding or even adaptive Huffman compression to tweak that a bit (though the resulting capacity would be data-dependent).

TL;DR: if you are expecting (as Lee Felsenstein did when he was designing the SOL-20 and the Pennywhistle modem in the mid-1970s - he deliberately tried not assume what replacement parts would be available later) to have to pull hardware out of landfills to avoid the Establishment's lockdown of new systems, you're likely to find that there are a lot more discarded USB flash drives than cassettes and cassette players. Just Sayin'.
Last edited by Schol-R-LEA on Sat Aug 19, 2017 10:35 am, edited 8 times in total.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
MichaelFarthing
Member
Member
Posts: 167
Joined: Thu Mar 10, 2016 7:35 am
Location: Lancaster, England, Disunited Kingdom

Re: Loading programs from casette tape

Post by MichaelFarthing »

To be really bullet proof shouldn't you support a method of input from an abacus? :-)
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Loading programs from casette tape

Post by Geri »

Schol-R-LEA: yeah, i starting to realize the baud rate will be extremely low, even lower than i tought.
2-3kbyte/sec would be sufficient, but it seems even half kbyte/sec is almost impossible .
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Loading programs from casette tape

Post by Schol-R-LEA »

Sorry, I was editing my last post again when you both replied. In case you missed what I added: if you are expecting to have to pull hardware out of landfills to avoid the Establishment's lockdown of new systems (as Lee Felsenstein did when he was designing the SOL-20 and the Pennywhistle modem in the mid-1970s - he deliberately tried not assume what replacement parts would be available later), you're likely to find that there are a lot more discarded USB flash drives than cassettes and cassette players. Just Sayin'.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Loading programs from casette tape

Post by Geri »

yeah, but thats hard to inserted into a computer platform (along with usb). meanwhile a casette player is just basically a few transistors. but yeah, it had more relevance with 8 bit computers, were programs were a few-few 10 kbytes large.

it would be not possible to do it with these type of encode.

maybe with storing non-binary numbers.... but i must meditate on it later.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Sik
Member
Member
Posts: 251
Joined: Wed Aug 17, 2016 4:55 am

Re: Loading programs from casette tape

Post by Sik »

Geri wrote:meanwhile a casette player is just basically a few transistors.
And a tad of mechanical parts.

Only reason to support old-school tapes is if you're going to support the earliest PCs which did indeed support tapes =P (IBM at the time thought people would take tapes as a cheap alternative to diskettes... that didn't happen). The only other kind of tapes I can think on are modern back-up tapes and those are their own unique beast that I'm not even sure if they can be used without dedicated drivers from the vendor.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Loading programs from casette tape

Post by Schol-R-LEA »

Sik wrote:Only reason to support old-school tapes is if you're going to support the earliest PCs which did indeed support tapes =P (IBM at the time thought people would take tapes as a cheap alternative to diskettes... that didn't happen).
It wasn't really that, per se; rather, tape was widely used in the mid to late 1970s (in the US - I understand it lingered well into the mid-1980s in the UK and Europe). There even was one for the original 1983 Nintendo Famicom, which was meant to be basically a hybrid computer/console a la the Coleco Adam, but was later stripped down and eventually became the basis for the NES when it was re-designed for export.

The first widely available floppy drives, the 8" and 5 1/4" Shugart drives (by same Shugart Associates who introduced the predecessor to SCSI as an interface for hard drives in 1978), cost about $1000 for the drive alone in 1976 (the year the 5 1/4" 'minifloppy' was introduced). At the same time, an Apple Computer (the original, as the ][ was still a year in the future), was selling for under $800 - including a cassette interface card (the base price for the computer alone was - no kidding - $666, though they would later say it was due the peculiarities of how the accounted for the manufacturing costs rather than any sort of numerology).

Also, it is worth recalling that prior to cassette, just one year earlier, the primary storage medium for first generation microcomputers (such as the MITS Altair 8800, IMSAI 8080, and Processor Tech SOL-20) was punched paper tape - and for the Altair (and several other kit sytems, sold by dozens of different electronics kit companies, using about a dozen different types of microprocessors - Intel 8080, 8008, and 8085; Zilog Z80; MOSTek 6502; Motorola 6800 and 6809; RCA 1802; National Semi SC/MP; and who knows what else - and all completely incompatible with each other), you needed to hand-solder both the system and the interface yourself, or pay someone to fix your kit for you (probably because you tried to assemble it and couldn't).

But hey, they were open systems - by necessity, since you had to be able to assemble the hardware (and maybe toggle in the boot loaders) by hand.


Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
Sik
Member
Member
Posts: 251
Joined: Wed Aug 17, 2016 4:55 am

Re: Loading programs from casette tape

Post by Sik »

Yeah I know, I was just talking about the context of PCs where tapes never managed to take off. Tapes being popular in other platforms is precisely why IBM considered them in the first place, it's just that their early users didn't want them (and later on tapes just stopped seeing any real use so support was removed altogether).
Post Reply