elks icon indicating copy to clipboard operation
elks copied to clipboard

suitability for HP 200LX?

Open ishotjr opened this issue 10 months ago • 19 comments

Has anyone run ELKS on the V20-based HP 200LX? I'd like to give it a try but the lack of floppy disk and requirement to instead write to PCMCIA (or CF) from Linux will be a bit more of a challenge, so I wanted to get a feel for feasibility first? 💗

ishotjr avatar Feb 22 '25 13:02 ishotjr

Hi @ishotjr, I should think ELKS will come up and run on the HP 200LX without problems. For your first pass, perhaps just grab a bootable image from the 0.8.0 Release page. Should there be issues, please report them and we might have to have you pull the repo and do a custom build, but we'll only know what is needed after seeing the boot screen.

Thank you!

ghaerr avatar Feb 22 '25 16:02 ghaerr

An educational purpose Uni*x clone called MINIX is available for HP 100/200/700LX and 1000 CX palmtops. It requires significant amount of tweaking to run on the unusual 80186 CPU + PCMCIA hardware.

fehertamaskyndryl avatar Mar 07 '25 10:03 fehertamaskyndryl

Now we have a CF card direct driver https://github.com/ghaerr/elks/pull/2357 meaning that it might be used as an alternative to the BIOS HD driver for ELKS or if there is a problem with the BIOS HD driver. Chatgpt is confident that CompactFlash (CF) cards via PCMCIA (PC Card) adapters do expose the ATA (IDE) registers needed for this driver.

So yes this new driver might allow you to mount a CF card on these HP machines.

toncho11 avatar Jul 16 '25 14:07 toncho11

Wow the base storage is a 2MB write once rom chip. Installing ELKS on it is nearly impossible as one needs to desolder, flash and put back a writable ROM. Quite a feat as all this is packed in a tiny space.

toncho11 avatar Jul 16 '25 14:07 toncho11

there's up to 4MB of RAM (depending on model/minus whatever is allocated to the system) that's bootable, but I'm really interested to learn about the CF support and will gladly give that a try once merged! ❣️

ishotjr avatar Jul 16 '25 14:07 ishotjr

there's up to 4MB of RAM (depending on model/minus whatever is allocated to the system) that's bootable, but I'm really interested to learn about the CF support and will gladly give that a try once merged! ❣️

How would you boot ELKS? Or maybe an image of ELKS can be stored in RAM and somehow ELKS can be booted from there?

toncho11 avatar Jul 16 '25 14:07 toncho11

Can you force booting from the CF card instead of the internal drive? In this case everything is kind of OK.

toncho11 avatar Jul 16 '25 14:07 toncho11

You mount the CF card from DOS and you try to boot an ELKS image from there? You need a special program for that similar to SYSLINUX or LOADLIN. There was something like that before, but it is not usable currently I think.

toncho11 avatar Jul 16 '25 14:07 toncho11

the device will boot to a PCMCIA card first if inserted, but I'm not sure if this is at the OS or BIOS level...

ishotjr avatar Jul 16 '25 14:07 ishotjr

Hello, MINIX was booted on the HP 100/200/700LX/1000 CX palmtops by running a DOS program, which kicked DOS out of memory and loaded Unix. Here are the tech details: https://web.archive.org/web/20060828125731/http://minix.technoir.org/

Note that HP palmtop used i80186 architecture CPU, which has no memory protection hardware whatsoever, so the OS loaded from ROM could be easily subverted. Because of that lack of memory protections (introduced from i286 and up), I doubt porting any kind of Linux would make much sense on the HP200LX. Even Windows 3.1 refused to run on it, needing a 286 CPU or better.

fehertamaskyndryl avatar Jul 16 '25 14:07 fehertamaskyndryl

I remember running Minix on my 200LX, using a 24MB CF card in a PCMCIA adapter, before the LCD's flat cable was destroyed by an unrelated battery leak. Minix was fairly complete, it even had wheatstone, etc. performance benchmarks and text-based games, like advent.

If I had a PCMCIA slot doubler for the palmtop, even TCP/IP could have been used in Minix, with the Accton EN-2216 or Silicom ethernet cards. I think the lack of convenient networking would be a big discouragement for trying to port Linux to 200LX, because the palmtop only has a non-standard infrared port and 115kbps RS-232 built in.

fehertamaskyndryl avatar Jul 16 '25 14:07 fehertamaskyndryl

The HP Omnigo 700LX was a special variant of the 200LX, where a PCMCIA slot-doubler was built into the palmtop body, housing a Nokia mobile data card for the direct-attach Nokia 2110 GMS phone and still providing one free slot for e.g. flash card. Some people have removed that GSM card and installed an Accton EN-2212 / 2216 ethernet instead, to run Minix or Windows 3.0 from flash card with TCP/IP networking. The 700LX is fairly rare however and had a design problem, where the overweight top half broke the main hinge, so most would be wrecks by now.

Between the ethernet PCMCIA cards, Accton brand had a benefit over Silicom, as the EN-2212/2216 could be used with over-clocked 200LX. It was fairly popular aftermarket modding to replace the factory CPU tact crystal (15.8 to 32MHz) but more HW mods or tweaked DOS drivers were required to compensate for the rushed timekeeping. See here: https://www.200lx.net/upgrade.htm

fehertamaskyndryl avatar Jul 16 '25 15:07 fehertamaskyndryl

In this Reddit thread there are photos of the "AccuRite DoubleSlot" PCMCIA adapter for the HP palmtop: https://www.reddit.com/r/OldHandhelds/comments/1jww7i4/defective_hp_200lxbut_there_is_something_more/

fehertamaskyndryl avatar Jul 16 '25 15:07 fehertamaskyndryl

Here we are not talking about Linux, but ELKS. ELKS runs on anything from the original 8088 and above. The tool needed is called bootelks and it is discussed here: https://github.com/ghaerr/elks/issues/2117#issuecomment-2516516525 It even mentions hp 200LX.

The tool is available here: https://github.com/rafael2k/bootelks Honestly the procedure is not very clear. Maybe @rafael2k can elaborate more on that. At least in theory it is doable.

toncho11 avatar Jul 16 '25 18:07 toncho11

MINIX was booted on the HP 100/200/700LX/1000 CX palmtops by running a DOS program, which kicked DOS out of memory and loaded Unix.

Yes, that program acts effectively as a boot loader and uses DOS to read the kernel image into memory, then jumps to it, much like MINIX is loaded from a real boot loader.

I doubt porting any kind of Linux would make much sense on the HP200LX. Even Windows 3.1 refused to run on it, needing a 286 CPU or better.

That's all true for standard Linux, but ELKS, derived from a 30+ year old fork of Linux in the very early days, implements the same POSIX set of system calls and runs on a wide variety of 8088/8086 machines in as little as 256K RAM. The system includes a bash-compatible shell and TCP/IP networking, all without any MMU.

I think the lack of convenient networking would be a big discouragement for trying to port Linux to 200LX, because the palmtop only has a non-standard infrared port and 115kbps RS-232 built in.

ELKS supports TCP/IP SLIP over serial and works great, along with included telnet and ftp client and servers.

photos of the "AccuRite DoubleSlot" PCMCIA adapter for the HP palmtop:

We've recently implemented CF support via ATA, XTIDE and XTCF, but I'm not familiar yet with how PCMCIA differs. That could be added, but certainly the first step would be someone actually going through the steps to boot ELKS on 200LX using bootelks. That will involved getting familiar with exactly how bootelks works. For those interested, I would recommend using bootelks on a DOS desktop getting ELKS booted first, then moving to doing the same on 200LX.

ghaerr avatar Jul 17 '25 16:07 ghaerr

BOOTELKS - Boot ELKS from DOS

This setup allows you to load the ELKS kernel from a DOS environment using BOOTELKS.COM.

REQUIRED FILES

  1. BOOTELKS.COM

    • The DOS program that loads and starts the ELKS kernel.
  2. IMAGE

    • The ELKS kernel image file. The ELKS' kernel is called "kernel" and must be renamed to "image".
    • Must be the raw kernel binary, not a floppy or disk image.
    • Can be compiled from ELKS source or obtained prebuilt.
  3. INTS.BIN

    • A binary dump of the system's Interrupt Vector Table (IVT) and BIOS data.
    • Must be exactly 0x500 (1280) bytes, copied from RAM starting at segment 0x0000.
    • Created using the GETINTS utility described below.
  4. GETINTS.COM

    • A small DOS program to dump the first 0x500 bytes of memory.

    • Run it under a clean DOS environment to generate INTS.BIN.

      Example usage:

      GETINTS > INTS.BIN

SETUP INSTRUCTIONS

  1. Boot into a clean DOS environment (MS-DOS or FreeDOS). Avoid loading memory managers or TSRs.

  2. Place the following files in the same directory:

    • BOOTELKS.COM
    • IMAGE
    • INTS.BIN

    Example directory layout:

    A:\ELKS
    ├── BOOTELKS.COM ├── IMAGE └── INTS.BIN

  3. Run BOOTELKS:

    BOOTELKS

    This will:

    • Load the IMAGE (ELKS kernel) into memory.
    • Restore BIOS state from INTS.BIN.
    • Transfer execution to ELKS.

NOTES

  • You must create INTS.BIN only once per machine (or BIOS environment).
  • BOOTELKS is not compatible with compressed kernel images.

TROUBLESHOOTING

  • If BOOTELKS hangs or resets, ensure:
    • The IMAGE is a raw, valid ELKS kernel.
    • INTS.BIN is correct and generated in a clean DOS state.
    • No drivers or memory managers (like HIMEM.SYS or EMM386) are loaded.

@rafael2k is this correct?

toncho11 avatar Jul 17 '25 18:07 toncho11

So you need a fat partition on the CF card which will contain the bootelks files and the ELKS' files needed to continue after the kernel is loaded such as /bin/bash. Kind of crazy. And the kernel must know to mount as root the CF card when its load and execution is done. Quite a lot of things must go right.

This could first be tested on a regular desktop with c: and d:

The MS DOS on the HP should not load any memory managers, which might not be the case. This might interfere with the vectors table we need to record. You probably need to put an ELKS fat image on the card and then add the bootelks files. This way you will get the kernel file that you need to rename to "image" and insure the CF card is "mountable" by ELKS.

toncho11 avatar Jul 17 '25 19:07 toncho11

So you need a fat partition on the CF card which will contain the bootelks files and the ELKS' files needed to continue after the kernel is loaded such as /bin/bash. Kind of crazy.

Pretty straightforward - take an ELKS distribution in FAT format, and add bootelks.com to it. When running DOS, the CF card is readable, one would run bootelks.com. After booting, ELKS comes up and mounts the same CF card as a FAT filesystem, which the runs normally, producing a login: prompt and after a bash prompt.

And the kernel must know to mount as root the CF card when its load and execution is done.

I've added that capability in PR #2357, which is working on QEMU. However, that will ultimately need to be tested on real hardware, such as your Amstradt or any other modern PC with a CF card accessible via an ATA (or XTIDE or XTCF) interface.

Quite a lot of things must go right.

I think the biggest issue is bootelks.com - no-one has run it for years. It may expect an older format of ELKS, I have no idea. I don't run DOS at all, and somebody needs to look at bootelks source code to understand what its internal loader is expecting. Not a big deal, just takes someone with a DOS box and some knowledge of compiling and playing around with ELKS.

This could first be tested on a regular desktop with c: and d:

Definitely try getting bootelks.com running on a desktop floppy DOS system first, using an ELKS distribution floppy with bootelks.com added to it.

ghaerr avatar Jul 17 '25 19:07 ghaerr

BOOTELKS - Boot ELKS from DOS

This setup allows you to load the ELKS kernel from a DOS environment using BOOTELKS.COM.

REQUIRED FILES

1. BOOTELKS.COM
   
   * The DOS program that loads and starts the ELKS kernel.

2. IMAGE
   
   * The ELKS kernel image file. The ELKS' kernel is called "kernel" and must be renamed to "image".
   * Must be the raw kernel binary, not a floppy or disk image.
   * Can be compiled from ELKS source or obtained prebuilt.

3. INTS.BIN
   
   * A binary dump of the system's Interrupt Vector Table (IVT) and BIOS data.
   * Must be exactly 0x500 (1280) bytes, copied from RAM starting at segment 0x0000.
   * Created using the GETINTS utility described below.

4. GETINTS.COM
   
   * A small DOS program to dump the first 0x500 bytes of memory.
   * Run it under a clean DOS environment to generate INTS.BIN.
     Example usage:
     > GETINTS > INTS.BIN

SETUP INSTRUCTIONS

1. Boot into a clean DOS environment (MS-DOS or FreeDOS). Avoid loading memory managers or TSRs.

2. Place the following files in the same directory:
   
   * BOOTELKS.COM
   * IMAGE
   * INTS.BIN
   
   Example directory layout:
   A:\ELKS
   ├── BOOTELKS.COM
   ├── IMAGE
   └── INTS.BIN

3. Run BOOTELKS:
   > BOOTELKS
   
   
   This will:
   
   * Load the IMAGE (ELKS kernel) into memory.
   * Restore BIOS state from INTS.BIN.
   * Transfer execution to ELKS.

NOTES

* You must create INTS.BIN only once per machine (or BIOS environment).

* BOOTELKS is not compatible with compressed kernel images.

TROUBLESHOOTING

* If BOOTELKS hangs or resets, ensure:
  
  * The IMAGE is a raw, valid ELKS kernel.
  * INTS.BIN is correct and generated in a clean DOS state.
  * No drivers or memory managers (like HIMEM.SYS or EMM386) are loaded.

@rafael2k is this correct?

I'm not sure, but if it works, lets add this to the README.

rafael2k avatar Jul 17 '25 22:07 rafael2k