Replies: 6 comments 18 replies
-
Hello @lazylinol, Sounds like you've got a fun project planned! :) It should be fairly straightforward for you to develop a port to your custom board, as ELKS can be configured for a minimum of dependencies and no BIOS (although I may not remember all the dependencies right now). I've commented below on your various questions; feel free to ask more questions and we'll help you with more specifics as you move forward in your port.
In general, we now have three "platforms" that are supported using configuration defines: IBM PC and compatibles (using CONFIG_ARCH_IBMPC), the PC-98 Japanese desktop PC (CONFIG_ARCH_PC98), and a ROM-based system based on the 8018X processor (CONFIG_ARCH_8018X). Thus, I recommend that you find the latter define within the sources for more details, as we'd probably want to start by defining that, then changing the code/files that won't work. The 8018X port has no disk but boots from ROM, and runs the headless console out the serial port for communication. All of this would be a good starting point for you.
You'll definitely want a PIT as ELKS multitasking depends on it (although even that can be removed with some special defines/work for very prelim development). The 8018X has an internal PIC. You may need to rewrite both these kernel functions for your system. Take a look at elks/arch/i86/kernel/{irq-8018x.c,timer-8018x.c}.
setup.S isn't used for ROM based systems, so all that code can be ignored. Instead, the startup configuration, including ROM addresses, is statically defined in include/linuxmt/config.h.
You'll want the headless console, but that console driver sits on top of a minimal 'conio' API, which defines functions for reading, writing and polling the "console". In the 8018X case and yours, that would be the serial port. You won't need an interrupt driven keyboard driver. The serial port can be accessed in a non-interrupt fashion if desired.
You don't really need any, other than the PIT/PIC. The other drivers can be configured to use custom calls as described above. Also, take a look at Documentation/text/porting-guide.txt. I hope this helps - feel free to look closer at the source code, and post more questions! :) Thank you! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Actually, I was in error - the setup.S code is still used for CONFIG_ROM versions, even though a much smaller startup sequence is executed due to the lack of need for any relocation and other system hardware specifics. I had also forgotten about the INT 19h stub that is already there - that was written to allow an ELKS image to be created as an PC-compatible BIOS ROM extension and auto-booted.
I'm not quite sure what is happening without INT 12h, as the CONFIG_ROM version in setup.S doesn't appear to call it, and the only other place I remember its used is in the PC boot sector. Given that ELKS uses INT 12h solely to return the max RAM in AX, its possible that somehow the kernel itself thought there wasn't enough RAM to run /bin/sh. The free RAM is displayed at kernel startup, which should be inspected if you ever dive back into this. I would have to see a full diff to determine why the (supposed polling) keyboard is working without a kernel hardware timer. Perhaps after you get this all running we can get a look at what you've done for future reference. Keep us posted on your journey into getting an HD connected, as well as the hopeful PIT interrupt so you've got timesharing. I'm happy to help. |
Beta Was this translation helpful? Give feedback.
-
Whoa! NICE! Can I ask how you implemented the interface with the NE2k? Mine works, but I'm not sure if the IRQ signal is okay in design (I think it's negated for some reason, but maybe it's okay :) ). Have a look at my schematic: https://oshwlab.com/cocus/80c188eb-sbc. My board doesn't have a disk, but as @ghaerr mentioned, I've implemented a bit-bang SPI that talks to the SD card directly (using the SSD driver). |
Beta Was this translation helpful? Give feedback.
-
Initially it uses AUTO, which, I believe, for 2GB CF card would default to LBA translation, and supposedly that makes ELKS bootloader unable to correctly address the disk. But that is just my assumption, I still have to experiment around that, to be sure.
I might have to re-check if MAC reported by NE2K driver is meaningful, but IIRC Just quicky looked up the source for NE2K driver, it seem to use DMA in there. However 3Com 3C509 driver uses the PIO indeed, at least if I read the sources correctly. I remember having some other that NE2K network ISA cards, and there must be some with 3Com chips. I will give it a try and see if that works.
TBH, there is nothing too specific. In this machine I have full 16-bit ISA slot, so I just basically put the NE2K card in there. The only change that I had to make was to connect IRQ12 from the ISA slot (IIRC it is the IRQ used by NE2K) to the IRQ7 input of the interrupt controller, and let ELKS know that NE2K will use IRQ7 instead of 12. That was needed because my system does not have second PIC, hence only 8 IRQs are available. |
Beta Was this translation helpful? Give feedback.
-
Really interesting project! FWIW - the DMA mentioned in the NE2K driver is really a misnomer, referring to internal DMA on the NIC itself. It's all programmed IO as far as the CPU is concerned. You should be all set really. |
Beta Was this translation helpful? Give feedback.
-
I am building a computer based on 8086 CPU, which is planned to be somewhat hardware and software compatible with IBM PC XT.
What I've got so far is:
What is planned to have (from most important to less important):
At this point it is able to run simple programs, like basic CPU and memory tests, outputting progress to ISA POST card. Of course - nothing interesting yet, since it is not possible to communicate with it in any way.
But once I implement 16 bit transfers to lower portion of the bus - it will be possible to program and use ISA UART cards to interract with the machine, at least in polling mode.
And here to me comes the most interesting part. I would like to ROM boot headless ELKS on it at some point using UART console only, and wondering what are the bare minimum hardware and software requirements for it to start.
Looking at the sources, it seems that I would need at least both PIT and PIC from hardware point of view. Also, ELKS uses
int 10h
insetup.S
, and probably some other interrupts, and since my system does not have any BIOS in ROM I would need to implement those interrupt handlers by myself. Another thing, looks like it is not possible to compile ELKS with headless console driver disabled, keeping serial console only. Per my understanding - headless driver still uses keyboard polling, and since it is not possible to disable it - I will probably need keyboard controller as well.With that said, my questions are:
int 10h
are needed?Sorry for long post :) and thank you for your attention!
Beta Was this translation helpful? Give feedback.
All reactions