Slashdot Mirror


Apple II DOS Source Code Released

gbooch writes "The Computer History Museum in Mountain View, California, is not just a museum of hardware, but also of software. The Museum has made public such gems as the source code for MacPaint, Photoshop, and APL, and now code from the Apple II. As their site reports: 'With thanks to Paul Laughton, in collaboration with Dr. Bruce Damer, founder and curator of the Digibarn Computer Museum, and with the permission of Apple Inc., we are pleased to make available the 1978 source code of Apple II DOS for non-commercial use. This material is Copyright © 1978 Apple Inc., and may not be reproduced without permission from Apple.'"

29 of 211 comments (clear)

  1. They printed off assembler by i+kan+reed · · Score: 4, Interesting

    Whatever your complaints about your job, at least debugging your code doesn't involve stepping through assembly on a pencil and paper virtual machine.

    1. Re:They printed off assembler by adisakp · · Score: 5, Insightful

      Whatever your complaints about your job, at least debugging your code doesn't involve stepping through assembly on a pencil and paper virtual machine.

      That was how I wrote my first published game back in the 80's. I have no complaints. Everything was new back then and even though the "wheel hadn't yet been invented", programming was still exciting and it was some of the most fun coding I have ever done.

    2. Re:They printed off assembler by i+kan+reed · · Score: 4, Insightful

      I like to imagine every new programmer has that amazing sense of euphoria as they begin to uncover all the major algorithms for themselves, and begin developing a sense of just how much is possible with programming.

      Then it's your job. To give the end-user some uninteresting but necessary layer of data connectivity.

    3. Re:They printed off assembler by _merlin · · Score: 4, Informative

      Actually it does. That's how we track down compiler bugs, and also how we backtrack from crash location to look for the cause when we have a core from an optimised build.

    4. Re:They printed off assembler by kylemonger · · Score: 4, Interesting

      It didn't involve pencil and paper for long on the Apple II. I remember reading about a step-trace 6502 debugger for the Apple II back then. I didn't have any money to buy it so I wrote my own (in assembler of course) to ease debugging of a video game I was writing. It wasn't a hard job; the 6502 instruction set is small and straightforward and the CPU only has three registers.

    5. Re:They printed off assembler by oldhack · · Score: 5, Interesting

      Reading 6502 assembly is easier than reading some of today's bloated and convoluted Java/Perl/FP/what-have-you code. It's not like the assemblies of modern CPUs with OOE, branch predictions, and all such complexities.

      Also, from a technical perspective, publishing source for 6502 machine code wasn't that big a deal. You could recreate a reasonable assembly source from the machine code by spending some time with reverse assembler (unless the code does goofy things like writing over its code and such). In fact, Apple II monitor code had a nifty reverse assembler built in.

      --
      Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
    6. Re:They printed off assembler by NormalVisual · · Score: 3, Interesting

      In fact, Apple II monitor code had a nifty reverse assembler built in.

      I'm sure there are a lot of us that remember "CALL -151"... :-)

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
  2. Contradictory? by innocent_white_lamb · · Score: 3, Interesting

    It's being "made available" but it "may not be reproduced."

    How does that work, again?

    --
    If you're a zombie and you know it, bite your friend!
    1. Re:Contradictory? by pregister · · Score: 4, Informative

      Non-commercial uses have permission. Commercial uses don't. You may not reproduce it without permission. Wheres the problem?

  3. Re:Good thing it's non-commercial by i+kan+reed · · Score: 4, Funny

    You never know... I'm not sure how far back in time Microsoft goes to rip off Apple; they do always seem to be pretty late to the party.

  4. Non-commercial purposes only? by eclectro · · Score: 4, Funny

    Because it could be a competent competitor to current Apple products?

    I know I want an Apple II smartphone that I could play Oregon Trail on and make phone calls back to the '70s with!

    --
    Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
  5. Atari DOS source code was published by crow · · Score: 3, Informative

    Back in the day, the source code for Atari DOS was included in a published book that explained exactly how it worked. That's one of the things that was great about that platform--so much information was readily available.

    It was all written in 6502 assembly. Anyone that cared would disassemble it themselves, so it's not like there were any big proprietary secrets to protect. I'm surprised that this wasn't published 30 years ago.

    1. Re:Atari DOS source code was published by Em+Adespoton · · Score: 3, Insightful

      IIRC, the change occurred in the mid to late 90's, as software and hardware got complex enough that a lot of it started being subcontracted, and storage got large enough that you could store the entire set of plans digitally, making both the plans and the documentation much more mobile. However, the shift really began in the mid 80's, when the increasingly complex manuals started being "available" instead of provided by default.

      Some examples include the Apple IIGS being the first Apple-based PC (as opposed to Mac or Lisa) that didn't come with schematics; a few years earlier, the Mac came out with the full manual, but no schematics and a sealed case. By the time the IIGS stopped being sold, all Apple products came with a "getting started" manual, but the detailed information was only available via digital format, or by an "Inside Macintosh" subscription. Then, with the advent of the iMac, Apple stripped it back even further -- by this point, they'd separated information out between what a developer would need and what a "user" would need.

      Back in the early days of personal/hobby computers, there was no "user" -- the person behind the keyboard cooperated with those who had made the base hardware and software to create solutions to problems.

      So, I guess you could argue that the real fall of the old school access to information started as "applications" replaced "programs" on computers, and ended when most computer brands came in a model where the warranty was void if the case was opened. I'd say the transition range was roughly 1983-1996.

  6. Game disk images in licensed emulator bundles by tepples · · Score: 5, Interesting

    Lately it has become common for companies that own copyright in decades-old video games to rerelease the games in an emulator that runs on a modern platform. If a video game for Apple II requires Apple DOS, the game's copyright owner has two options. It can license Apple DOS in order to distribute it as part of the game's disk image bundled with the emulator. Or it can change the emulator to use high-level emulation for the BASIC integration, file system, and RWTS (block device driver) that make up Apple DOS.

    1. Re:Game disk images in licensed emulator bundles by Charliemopps · · Score: 4, Insightful

      Copyright should end after 10yrs max. Whatever paltry profits apple may stand to gain from hording things like this to themselves pale in comparison to the lost history if such things are destroyed before they're ever released to the public.

    2. Re:Game disk images in licensed emulator bundles by Anonymous Coward · · Score: 5, Interesting

      Have you considered the possibility that Apple simply wouldn't release the source code at all, if there were no copyright protection?

      To keep companies from "hoarding," as you put it, would require a sort of negative copyright, where they are forced to escrow their source code for public release at the end of the copyright term (which would also need to be reduced). This is an interesting idea; if you want copyright protection, you have to vouch that you will release what is being protected at the end of the term. Sounds fair to me. If you don't like it, you'll have to rely on trade secrecy instead.

    3. Re:Game disk images in licensed emulator bundles by TheLink · · Score: 3, Insightful

      Hundreds of years ago copyright was just 14 years.

      With productivity and efficiency supposedly increasing, the rate of innovation supposedly increasing, the costs of distribution going down, and reach of distribution increasing, when copyright and patent terms are changed shouldn't it be for the shorter instead of longer?

      Copyright terms that last more than a century prove something is wrong.

      --
  7. Re:Legacy Support by stewsters · · Score: 4, Informative

    Ask and ye shall receive?
    http://www.virtualapple.org/

  8. 6502 assembly too hard to read by JoeyRox · · Score: 4, Funny

    Can someone please transcribe this into 6502 binary instructions and place it onto punch cards for easier reading?

    1. Re:6502 assembly too hard to read by NormalVisual · · Score: 4, Informative

      Seriously? 6502's and punched-cards together? What a wretched anachronism.

      FTA: “DOS was written on punch cards. I would actually hand-write the code on 80-column punch card sheets. A guy at Shepardson named Mike Peters would take those sheets and punch the cards. The punch cards would then be read into a National Semiconductor IMP-16 and assembled, and a paper tape produced. The paper tape was read into the Apple II by a plug-in card made by Wozniak, and I would proceed to debug it. As the project got further along and the code was all written, and it was debugging and updating, I would mark up a listing and give it to Mike Peters who would then change whatever was necessary and deliver me a paper tape and I’d start again.”

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
  9. Re:What took so long? by geekoid · · Score: 4, Insightful

    ", I just wish there was a popular 8-bit machine out there for the young'ns to get them started.
    That's like saying people need to learn to drive on a model T.

    My kids had no problem getting started on modern hardware.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  10. Listing were used like tablets today ... by perpenso · · Score: 4, Insightful

    Whatever your complaints about your job, at least debugging your code doesn't involve stepping through assembly on a pencil and paper virtual machine.

    Back then it was actually easier to read through large amounts of code, flipping between different sections, etc when it was on paper.

    The listing wasn't used for paper and pencil emulation, we had quite nice integrated editors and debuggers to see what was going on (ex. the LISA 6502 assembler). The listings were for reading and understanding. These lists were used somewhat like tablets today. You can take the listing anywhere, flop down on the couch and start reading, ...

  11. Re:What took so long? by viperidaenz · · Score: 4, Informative

    8 bits and popular, designed to get people started.
    http://www.arduino.cc/

  12. Re:Legacy Support by sjames · · Score: 4, Insightful

    Some sort of virtual machine is the correct way to do legacy support. In some cases full virtualization is the answer, in others, a thinner layer that looks like the old OS to the application and like a modern app to the outer OS might be more appropriate.

    The MS approach of keeping the severely broken APIs around forever is NOT the answer.

  13. Disassembly by tepples · · Score: 4, Informative

    Have you considered the possibility that Apple simply wouldn't release the source code at all, if there were no copyright protection?

    To keep companies from "hoarding," as you put it, would require a sort of negative copyright, where they are forced to escrow their source code for public release

    I don't see why escrow would be so critical when someone with more time than money could just disassemble, document, and distribute a program. This already happens underground. Absent copyright enforcement, there would simply be no formal negative consequences for doing so.

    If you don't like it, you'll have to rely on trade secrecy instead.

    You'd have to keep the binary secret too in order to thwart a disassembly attack. Good luck keeping a binary secret from end users who who run it on hardware that they own. The sort of DRM seen in, say, game consoles has always failed within a few years.

  14. Re:Legacy Support by tlhIngan · · Score: 4, Informative

    Meh... While I can see the value, this is exactly the problem that Windows is stuck in. Although they aren't completely backwards compatible, they try to be backwards compatible for a lot of stuff, which means they have to hold on to libraries which are poorly designed, and in some cases incorrect implementations because so much software depends on the incorrect implementation. MacOS is much cleaner because it has maintained less backwards compatibility. If you want to run old software, do it in a virtual machine, and allow the OS itself to evolve and drop the baggage of keeping the compatibility. Not to say that everything should be changed every OS iteration, but there needs to be a process for getting rid of the cruft.

    No what happens is that Windows has to work around everyone else's bugs - a lot of nasty developers don't do things the proper way and Windows suffers. It's why "C:\Documents and Settings" exists still on Windows Vista/7/8 - too many developers hard code that string (including the "C:\" part!) that not having that hard link means programs break.

    Apple decided to take the other method - basically dictating that if you do not use just the published APIs, your programs will probably break. Yes, you can use private APIs. But as per the warning, Apple has full right to change the private APIs as they see fit.

    Which is better? There's no consensus - Microsoft's means your programs still working, crappy coding and all, but you have to live with the fact that you still have a window named "Program Manager", that if you use a localized version of Windows, you'll eventually have a "Program Files" folder show up (yes, it's localized) because some program hard coded it, etc.

    Apple's means a leaner system because all these hacks don't need to exist - private APIs are not fixed in stone but can change and be updated as time goes on and deleted when necessary, rather than having to hang around because some app uses it.

  15. Re:Then versus now by larry+bagina · · Score: 4, Funny

    Well, that was written before the line feed shortage. Things were different back then.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  16. Re:Then versus now by NormalVisual · · Score: 3, Insightful

    It's really not that bad, although 6502 assembly was (for me, anyway) more challenging than 68K because the 6502 didn't have many registers to work with. You just have to decompose the problem down another level, and as long as you're paying reasonable attention to detail, it's really not that much worse than writing something in C.

    --
    Please stand clear of the doors, por favor mantenganse alejado de las puertas
  17. Atari would have kept their secrets if possible... by Dogtanian · · Score: 4, Informative

    Back in the day, the source code for Atari DOS was included in a published book that explained exactly how it worked. That's one of the things that was great about that platform--so much information was readily available.

    Yes, but possibly in spite of, rather then because of, Atari themselves. According to the book "Hackers" by Steven Levy, the Atari 800 was treated as a closed platform in the early days, and Atari wouldn't divulge documentation on its inner workings;

    Transferring his new assembly-language skills to the Atari was difficult. The Atari was a "closed machine". This meant that Atari sequestered the information concerning the specific results you got by using microprocessor assembly-language commands. It was as if Atari did not want you to be able to write on it. It was the antithesis of the Hacker Ethic. John would write Atari's people and even call them on the telephone with questions; the voices on the phone would be cold, bearing no help. John figured Atari was acting that way to suppress any competition to its own software division. This was not a good reason at all to close your machine. (Say what you would about Apple, the machine was "open", its secrets available to all and sundry). So John was left to ponder the Atari's mysteries, wondering why Atari technicians told him that the 800 gave you only four colors in the graphics mode, while on the software they released for it, games like "basketball" and "Super Breakout", there were clearly more than eight colors.

    Of course, it's true that all this stuff was *later* very well-documented, but how much Atari helped in that is open to question (*). It's certainly well-known that Atari were assholes in general in their late-70s/early-80s heyday, and they definitely tried to suppress third-party development of VCS games. So though I've heard enough people disputing aspects of "Hackers" not to take it as gospel, it does seem to tie in with what I've heard about Atari at the time.

    The Atari DOS book doesn't appear to have been published by Atari themselves, and whether it was with their blessing, I don't know. "Mapping the Atari" wasn't an official publication either.

    While Atari released documentation, I suspect it was at the level *they* wanted people to be using the machine at. And for all their plus points, the 400 and 800 were clearly intended as more closed, consumer-oriented machines. The 800 did have some good expansion capabilities, but this was clearly meant to be done via its official ports and interfaces designed for that use. The lower-end version, the Atari 400 had far less official expansion capability, e.g. it was never originally designed to support RAM expansion- it was possible, but apparently required far less friendly hardware modifications and installation directly onto the motherboard.

    The 1200XL was notoriously even more closed (and flopped massively). FWIW, the BASIC "manual" that came with my 800XL was a paltry pamphlet, and the official DOS 3 manual was nicely-presented, but certainly not deep.

    Of course, it all worked out in the end, but I guess what I'm saying is that let's not romanticise the original intentions of companies like Atari back then, who'd have been happy to sit on those secrets and not release them to their users (who they viewed as potential competition).

    (*) Those early days (1979 onwards) were before my time- I got my 800XL in 1986, so I can't speak from personal experience.

    --
    "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).