8

I want to create my own boot disk (an image file to use with simh) from my own PDP-11 code but I don't know how the code needs to be written to the disk/file so that it boots. I can load my code using absolute loader but I want to use a disk.

What is the format of PDP-11 disks that the computer will load code from at boot?

  • Welcome to Retrocomputing Stack Exchange. Please read the tour. I'll have a go at editing your question - feel free to edit it again (or revert the edit) if I have removed something that is important to the question, or edit to add more information. – wizzwizz4 Nov 8 '17 at 17:37
  • 1
    Under which PDP-11 OS? Unix, RT-11, something else? AFAIK the simh boot command just reads a block (probably the first) and then executes it, so you can write your own bootloader if that is what you want, but I'd have to look up details and/or read source code. – dirkt Nov 9 '17 at 8:07
  • I'm wanting to write my own boot loader. I've now looked at the simh source for RL11 disks and done some testing and it seems that the first 4 sectors (of 256 bytes each) are read into memory starting at 0 and then code execution begins from address 0. The boot code itself is loaded into memory starting at octal 2000. I've now managed to get Hello World to display when booting from my DL11 disk image file. – retropdp Nov 9 '17 at 12:33
  • Can you indulge my curiosity and tell me, how can I get my hands onto something that feels like a PDP-11 at least on the software side? An emulator would suffice, although I'd be curious for real modern hardware too. – Oleg Lobachev Dec 27 '17 at 18:38
5

There is no specific 'format' required.

On a real PDP-11, what happens at bootup depends on what kind of boot PROM you have installed. In general, for disk-type devices the convention is to load the first block then jump to the code in that block. If you don't have a boot PROM for the device you want to boot from, you may have to toggle in a bootloader yourself (if your PDP-11 doesn't have console switches you can usually "toggle in" code using the console terminal instead).

Here is a web page containing sample bootloader code for various devices (including some non-disk devices): http://www.psych.usyd.edu.au/pdp-11/bootstraps.html

So effectively the only requirement to be able to boot is, you must work within whatever limits your boot PROM imposes. Typically this means you're limited to 256 words (512 bytes), and sometimes the first word must have a specific value for the boot block to be considered valid.

Beyond the first block (the "boot block"), there are usually no requirements on disk format. Normally the format of the disk will be determined by the operating system you are booting.

If you want to, you can simply have your program occupy the blocks that follow consecutively after the boot block, and put a small program into the boot block that just loads those additional blocks, then jumps to the first one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.