Welcome to PDOS (Public Domain Operating System) and PDPCLIB (Public Domain Project C Library)

For the benefit of blind and deafblind users, the above pictures, which are in fact just text, as everything in PDOS is, can be found in text format here.

There are two major components to the PDOS project:

PDOS: Public Domain Operating System

This is an operating system, with a user interface as simple as MSDOS, but behind the scenes the story is quite different. One distribution supports both 32-bit Windows (subset) and 32-bit MSDOS (there was never a real one of those). One distribution supports 16-bit MSDOS (subset). One distribution supports the MVS API (subset) in AMODE 24, 31, 32 and 64 (but only uses the lower 32 bits in AMODE 64).

PDPCLIB: Public Domain Project C Runtime Library

The most commonly used component, thanks to GCCMVS (port of GCC to IBM mainframe) is PDPCLIB which is a public domain C runtime library which you can link your own C programs against to produce executables with no licencing restrictions (even if you use a compiler, commercial or non-commercial, that does have licencing restrictions). PDPCLIB works on MSDOS, OS/2, Win32, PDOS/386, MVS (mainframe), CMS, VSE, AmigaOS. The library conforms to the ISO/IEC 9899:1990 (aka ANSI X3.159-1989 aka C90 aka C89) standard. It has no extensions so is particularly good at finding out if your code is truly portable.

PDOS/386 hard drive image

Base functionality of PDOS/386 has now been completed. No further functionality is required for a basic functional system. There are also no longer any known, reproducible integrity bugs, so the system is nominally stable (but make sure you regularly back up any work for now). It is self-hosting, allowing both the OS and the tools to be rebuilt under PDOS/386. A disk image is available here, and an ISO CDROM image here. The hard disk image is suitable for burning to USB (using a utility such as Win32 Disk Imager - note that you need to select "all files" instead of the default ".img" to see the .vhd) to boot on real hardware, or it can be run under an emulator, e.g. Qemu with "qemu-system-i386 -drive file=pdos.vhd,index=0,media=disk,format=raw" or Bochs. When you boot it, you can type "dir" or "help" or "type /p readme.txt" for more info. Every OS-related byte on that disk is public domain, starting with the MBR (which I didn't write, but I found a PD version and modified it). Note that the disk image is a little less than 500 MB in size, with about 300 MB free space, so you need a USB stick that is at least 500 MB in size. In order for the USB stick to boot, you will need a PC that supports booting from USB stick as a hard disk image, and it will also need to support "legacy boot" (ie have a BIOS). You probably need to disable "secure boot" before legacy boot is allowed. Some modern PCs don't support legacy boot so maybe next time you buy a PC make sure you can boot PDOS/386 from USB stick. Also there is a floppy disk image here if you prefer that. And the same floppy disk image here as a bootable ISO CD. There is also a distribution of Freedos here built using this procedure that provides both another method of running (some) Windows programs, as well as running the (included) Open Watcom compiler that is used to develop PDOS/86 and the 16-bit IO.SYS that is included in PDOS/386. Also there is another version of the PDOS/386 disk image, except with essential build tools as OS/2 2.0 LX executables so that you can mount the image on OS/2 and fight your way out. You can still boot it, as PDOS/386 supports (certain) OS/2 executables too. Available here. Ditto Linux. Also be aware that if you have the pdos.vhd on a Unix system, you can access the contents with a command like "sudo mount -o loop,umask=000,offset=$((504*512)) -t vfat pdos.vhd mnt". On a Mac it is "hdiutil attach -imagekey diskimage-class=CRawDiskImage pdos.vhd". And if you need more space, I have a blank (no MBR either) 2 GB disk here.

University Challenge 80386

It is September 1986 and the Compaq Deskpro 386 has been released. This time the 40 MB drive has a PDOS/386 distribution installed on it. It contains pure public domain code. Due to the limits of what has been released to the public domain, only SubC is available, which gives you a subset of C90. But it's better than having to write in machine code. Your challenge is to produce a 32-bit competitor to MSDOS using just what is on this disk. Theoretically everything you need is on this disk. Get the 40 MB disk image here and ISO here. Note that the image was bumped up to nearly 500 MB in order to force Bochs to give better drive parameters so that an ISO could actually boot. See final2.bat for more information.

University Challenge 8086

It is March 1983 and the IBM PC XT has been released. You got a 20 MB drive instead of the standard 10 MB drive and instead of MSDOS/PCDOS 2.0, it comes with PDOS/86. It contains pure public domain code. Due to the limits of what has been released to the public domain, only SubC is available, which gives you a subset of C90. But it's better than having to write in machine code. Your challenge is to produce a better 16-bit competitor to MSDOS using just what is on this disk. Theoretically everything you need is on this disk. Get the 20 MB disk image here. Note - because someone used this image for real development and ran out of space, I have bumped the image up to 40 MB for now. A 360k floppy is also available here.

I also have a distribution of MSDOS 4.0 available here that could be used as an alternative starting point, which has Microsoft C 5.1 and MASM 5.1. Because of a technical issue preventing MSDOS 4.0 from reading the UC8086 disk, I have provided a disk formatted by MSDOS 4.0 to get the reserved sectors set to 1, and used PDOS/386 xcopy to copy the contents across to the new disk here. I should probably build xcopy for UC8086 to legitimize this operation.

University Challenge ARM

It is 2024 and instead of that Intel/AMD/Zhaoxin x86 shit, you bought a Pinebook Pro, Raspberry Pi or an Android phone with PdAndro installed. Or any computer running qemu-arm (user, not system). Can you reconstruct the world? GCC and SubC are available. Find out here and read readme2.txt instead of readme.txt. This development inspired a Linux 386 distribution as well (a 50k executable that runs certain win32 executables and certain OS/2 executables), plus Linux x64 (a 102k executable that runs certain win64 executables) and Linux 64-bit ARM (AArch64) that allows you to run bwbasic, a BASIC interpreter, so that you can learn programming on your Android smartphone.

University Challenge z/Arch

It is the year 2023. You have just bought a second-hand z/Arch (IBM mainframe) machine. It has no software. But it may have a working card reader or tape, and maybe a 3390 disk. For whatever reason you have been restricted to using just public domain software, which rules out virus-licensed crap like z/Linux. If all you have is a card reader, all is not lost. You can hand punch all the required cards - 3000 to IPL and a bit less than 12 million for a 3390 image. Given the amount of tedious manual work required, you probably want to relegate this to some woman, like Melinda Varian. You won't have a fullscreen editor for your 3270 terminal, but you have some rudimentary ability to create files using copycon etc. You don't have a C90-compliant compiler, but you do have something similar to Sector C, a subset of C90. It is unclear whether this is enough to fight your way out of your predicament. There are other terminal options such as 3275 (EBCDIC ANSI on an 3270 data stream) and 1057 (EBCDIC ANSI), to allow you to use a fullscreen ANSI editor like the (older) public domain version of MicroEmacs (3.6), which is included as command "e". The included listing.txt may assist with seeing the SVCs required in a multisc program to get PDOS to do something. z/PDOS is available here and assorted virus-licensed software (GCC, DIFF, UEMACS (newer version), EDLIN) is available here. Note that this version of PDOS is expected to be replaced by the z/PDOS-generic in development (basically a mini-clone of MSDOS, including FAT filesystem on FBA disks), which will hopefully even run on my Dream Computer.

Note also you can IPL direct to memory from DVD/ftp, and if you use Hercules/380 you can (believe it or not) even IPL from an EBCDIC ANSI terminal (you will need to run mfterm.exe on PDOS/386 or equivalent to support this, and use ctrl-] to switch to iplcrd.dat and use qemu with "-serial tcp::3270"). Hercules/380 is available as 32 bit or 64 bit and there is also a 32-bit Cygwin build which I tested with this cygwin1.dll. Note that the build process of z/PDOS makes use of MVS/380.

University Challenge x64

It is the year 2023. You have just bought a new PC. You might be a girl from Slovakia named Alica Okano and you have the spirit of freedom from communist slavery flowing through your veins. The PC asks you to agree to some license conditions. You say "fuck that" and start looking for alternatives, even if you have to write them yourself from scratch. UC386 is ruled out because this new machine is UEFI-only. However, UEFI is basically an OS itself (unless you want to be a dickhead and change the definition of OS that would also exclude MSDOS). But it would be good to use the Win64 API instead of the EFI API - no problem - just apply a little glue (a loader that resolves msvcrt.dll references to the internal C library being used by bootx64.efi) and hey presto - a (subset) clone of Windows 11. Available here. Try "type readme.txt" or "pdas --help" or "me readme.txt". Works on real hardware and Virtualbox too. qemu has an issue with the microemacs editor because it scrolls when it shouldn't be just because I wrote to the 80th column. "type" and "cd" work to some extent, but "dir" only works in the root directory. Sometimes executables differ slightly compared to the same run on Windows because of floating point values being slightly different when PDPCLIB is used. UCX64 uses quite a lot of memory (not sure how much), e.g. here is qemu with 256 MiB: qemu-system-x86_64 -drive if=pflash,format=raw,file=edk2-x86_64-code.fd -drive file=ucx64.vhd,index=0,media=disk,format=raw -m 256

There is also a hack that allows you to run some win32 programs instead. Just type "msdemo32.exe".

The same principle has been used to allow some win32 programs to run under OS/2 2.0 and above under what I am calling win32os2 as well as under Linux in what I am calling win32lin.

Another line of effort is an ELF executable that can be run under qemu-x86_64 (ie user, not system), which can hopefully target Win64 and pdas etc can handle, and stubs similar to SubC can be used, which will produce a pseudo-bios for SubC to use with the same calling convention (stack) and short == int == long == 64 bits.

SubC

Because of the importance of SubC, that is where development is now focused. The latest source code and MSDOS library can be found here.

Also a modification of the "book" version of SubC, suitable for use on Windows and presumably other Windows environments, including PDOS/386, can be found here.

Android Smartphone

There is an emulator called "Bochs" available from the Google Play Store which essentially turns your phone into a PC. Even a cheap US$40 Android phone with 1 GB of memory and 8 GB storage can be used. No phone service is required. Using bluetooth, you can transfer data between an Android PC and a Windows PC using a VHD instead of what would traditionally have been done using a floppy disk. A small (9 MB) VHD is provided here. You use this as a second hard drive so that it becomes your D drive. Or using an Android with OTG support, you can transfer data using USB stick from PDOS. Windows is not required. To get the scratch.vhd populated you will need to use the development version of PDOS-generic from sourceforge. You can copy to/from host files using ":".

Here are some more notes on the use of an Android. It is recommended that you get APK Generator, unzipandro from the Google Play Store or unzipandro as an APK, or here since Androzip is no longer available - so all references to Androzip should instead be to unzipandro, Bochs from the Google Play Store. The APK Generator allows you to create APK files which are standalone installation files. So after installing all 3 products, and preferably before you run them, and preferably on a new device with no personal information, you run APK Generator to create an Androzip.APK and a Bochs.APK. These two files can then be transmitted via Bluetooth to any new Android phone. No internet connection is ever required.

You also need to transmit at a minimum pdos.zip. You probably also want scratch.zip and potentially freedos.zip. You install the two packages. You probably need to change your settings to allow installation from unknown sources. You unzip the zip files using Androzip or you can use your file manager if it supports it. When you start Bochs and select the vhd, if it crashes, try selecting in-app instead of system, right down the bottom. If it is covered by ads, disconnect from the internet. If Bochs crashes when you click start, try renaming the vhd to img. To get files onto Bochs you can put them in a directory, click vfat, and select that directory. To get a file off Bochs, zip it using Freedos then use fil2dsk under pdos to copy onto hard disk image, destroying the disk and padding with lots of NUL characters. Rename the disk .zip and Androzip can cope with the padding. Other unzip programs may or may not cope. You can also zip a zip.

Note that I have successfully installed PDOS on an old Android (that cost US$15 delivered) with only 4 GB storage (less than 2 GB available to the user. But I needed to use an old version (2.6.8.20) of Bochs which I got from here and have made available here.

Another development on Android is that there are flavors of Android, probably not from Google, probably from China, that allow you to expose even internal storage as a USB mass storage device. If you connect your phone to a computer using the normal charging cable, PDOS will see a FAT32 disk with no MBR. The PDOS executables (in pdosbin.zip, not the hard disk image) can cope with the lack of MBR (but Freedos can't). You can install PDOS onto this disk and boot your PC from the Android. Or simply use it as a data disk. One version of Android I have will keep the USB mass storage active even after a reboot. Another version I need to reselect it after a reboot, so I go into BIOS setup after a reboot, to slow things down, then do the selection on the Android, and fortunately when I exit the BIOS the Android stays put. This effectively gives a PDOS PC the ability to transmit (from the Android) via bluetooth, without needing a USB stick or a phone with OTG support. The phone that I used successfully cost about US$20 delivered. No need to ever unplug anything if you are happy to dedicate the Android to the PC. Or instead of Bluetooth you could use Wifi to connect to the internet to send data such as mail packets via email or Discord chat.

For people who have only ever used a smartphone, not a PC, this video may assist in making sense of why PDOS doesn't behave the same as other apps on your phone.

For people who understand Tagalog (Philippines), there is a document here that shows how to run the main application, msged, on the Android.

Another new experimental development for the Android is native ARM PDOS-generic, sort of, called PdAndro, which can be found here and an updated version can be found here. The updated version will need you to unzip this in your Download (normally) directory. STOP PRESS! Now available on the Google Play Store. Also here. And get the applications from the "University Challenge ARM" section. You will need either the 32-bit or the 64-bit versions depending on what got installed. And we now have the ability to update the APK's bios.exe/libbios.so by using PdAndro itself, doing a command similar to: "../ucarm/dos/zip -align -0rX ../new.apk ." (note that dot is the current directory, and note that you need the 32-bit version) and then using SignYourApk (or here) and now at the Google Play Store to sign the new APK. You can see a demo of PdAndro being used here.

PDNet

PDOS/386 is good enough to run BBS software. But instead of using modems to exchange mail packets, data can be transferred using bluetooth, USB stick, or potentially the internet (email, Discord, Facebook). The cumulative mail packet as seen by 380:2/4 is being broadcast as read-only 380:2/12 and available here. Current list of nodes is available here. You need to copy the 0002000c.out to c:\bbs\temp.pkt and then run "dotb". The great thing about PDNet is that if some faggot doesn't like what you wrote, they can't just go crying to some private individual with power to click delete/ban. They instead need to get one of these guys to kick your door down, and then one of these guys to confirm that Article III Section 4 of this isn't worth the paper it is written on. And good luck with that. And even if you succeed, it just needs to wait until my daughter becomes the President of the Philippines, and makes sure the words actually have a meaning. Welcome to the free world, faggots.

Public Domain Software Philosophy

It is hoped that programmers from around the world who subscribe to this worldview will make themselves available to push this project forward.

Source code and Documentation

The source code is included in the PDOS distributions, but historical code and unreleased development can be found here.

Development Tools

Note that I use custom tools which you can find as source here and binaries here to build PDOS/386. The tools are also included on the main distribution. Also experimental ARM versions here suitable for running under PDOS-generic or BIOS for ARM (available here). Also initial versions of Win32 ARM executables available here. I've also created the World's Worst Linux Distro for testing of Linux 386 and x64 executables here. And I am distributing Linux Bigfoot (S/390 IBM mainframe) which is in development at the moment here.

EFI booting

If you want to see if your ARM or x86 system is capable of doing an EFI boot, you can try putting this on a USB stick and see if you get a "hello world" message. The above tools are capable of building EFI bootloaders for both environments. 32-bit PDOS-generic is now running as proof of concept here. And 64-bit here.

Official slogan

Whenever your computer is force-rebooting or crashing, or spending 5 hours doing an update, or running slow, always remind yourself "This wouldn't happen on PDOS".

Official advice

A wise man (Robert De Niro in "Heat") once said "Don't let yourself get attached to anything you are not willing to walk out on in 30 seconds flat if you feel the heat around the corner".

So, if you don't know how to write, or don't understand, or don't have unrestricted access to change the software you depend on, you probably shouldn't get attached to it. Everything I do on the Windows commmand prompt (using a text editor) is something that I can envisage doing on PDOS.

Testimonials

"Best 32-bit 80386 public domain C90 operating system starting with the letter 'P' that fits on a 360k floppy that I have used in the last 2 weeks!" - Paul Edwards.

"fun fact: i have this PC i wanted to put windows 11 on, but windows 11 literally somehow doesn't fucking work, or it works every other boot, for some obscure reason -- you know what worked on every boot on the same machine? PDOS" - Mintsuki.

"when windows is busy bluescreening for no reason, pdos doesn't, which is good" - Killaship1

"The u in pdos stands for unstable" - zdrwiiu

Frequently Asked Questions

Was PDOS written in Java? No, it was written in C90.

Was PDOS written in Cobol? No, it was written in C90.

Was PDOS written in Turtle Graphics? No, it was written in C90.

Was PDOS written in C++? No, it was written in C90.

Was PDOS written in C90? As a matter of fact, yes. PDOS was in fact written in C90.

Programming Tutorial

Now that both BASIC and C are available, you may be interested in learning how to program by following the tutorial here or here.

PDOS-generic

There is a beta version of another form of PDOS, "generic", which relies on an existing OS to act as a glorified "bios" meaning it is written in pure C90 and should be able to run on any platform. An old version for Windows available here and version tested for Amiga available here. You run by going "bios.exe pdos.exe pdos.vhd". Available commands are "dir", "type" and "exit". In another twist, a modification to PDOS-generic was able to produce a mini Amiga clone.

Solar

If you want to "go green", try restricting your computing usage to whatever this baby is capable of. Or if you want something that can fit in a backpack, try this one. And use it to charge a waterproof powerbank such as this. Note that the large solar panel can be used even if it is raining, but you need to hand-carry it rather than having it fold and fit in a backpack.

Credits

Historical information and some credits are available here.

Vlog

PDOS/386 has reached a point on 2023-04-17 (when serial port started working) where I thought it would be good to start using a computer with only public domain software on it to do my development. I am documenting that in my Vlog.

Contact

Most discussion of PDOS now happens on either this Discord server (note that my Discord id is "kerravon") or this, message area. PDOS is also mentioned in the alt.os.development newsgroup. There is also a semi-independent and not currently maintained Facebook page here. There was an old BBS sometimes available at bbs.pdos.org 64000 but it didn't have functionality to field support questions. I also used to run a BBS that could be reached using the "devil dialer" (historical name) which sends and receives files using zmodem after a connection is established using a traditional protocol called Wazoo. You were able to reach the BBS at kerravon.mooo.com 64001. You could send a message in any file. If you send code, including bug fixes, please specify that it is public domain. Also let me know if you wish your message to be private, otherwise I treat incoming messages as forum posts, and you can keep track of progress by requesting "forum.txt" from my BBS. If you want to listen to some decent music (definitely not in sorted order though), a lot of it hidden from the current public, try this.


E-mail Paul Edwards here.