-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building/porting ELKS in ROM #1795
Comments
Hello @fhendrikx, I'll try to reproduce this and comment. For the 8018x ROM build, which is the only officially supported build at the moment, normally one builds that using:
There are likely issues between the Thank you! |
Hi @ghaerr, Thanks for the tips. I also needed to "source env.sh" first, but otherwise, this is working. Thank you for your help. |
Hi @ghaerr I just tried the "emu86-rom.config" config. Running make gives me:
Interestingly, the config "emu86-rom-full.config" works just fine. It's probably useful to mention that I'm keen to eventually build an elks ROM image for a barebones (no BIOS) SBC based on the 8086 or 80286 (in real-mode only). I should probably drop a question about the best approach in Discussions, rather than hash it out any further here. |
Ok, I see now: it seems a prior enhancement has compromised the ROM build, when the ROM build doesn't support the BIOS disk driver. Let me fix that.
Yes, that includes the BIOS disk driver, which provides the undefined references in your link error(s) above.
That shouldn't be too big a deal, I suggest starting rom the "emu86-rom.config" after I post a fix for what you've just identified.
That's Ok, we can continue here, thank you! |
Thank you. So, the SBC we're building is not intended to be IBM PC compatible, so no BIOS. My understanding at present is that we'll need to:
|
Yes, so you'll want to run a "headless" console that will likely do I/O to/from a serial port. See CONFIG_CONSOLE_HEADLESS in elks/arch/i86/drivers/char/Makefile for more details. Other settings will be in emu86-rom.config.
To get an idea of which files might need changing (or replaced with versions specific to your architecture), check out elks/arch/i86/kernel/Makefile:
These pertain to the PIC (interrupt controller) and PIT (timer).
The 8018X port contains a version of the SSD driver accessing CF using a low-level SPI hardware interface. See the files referenced in elks/arch/i86/drivers/block/Makefile for more details:
|
Thanks for the further tips! Do you know if there is any wiring information about this SPI interface? Keen to understand how it is wired. |
Hello @cocus, do you have any info you can share on how your SPI interface was wired for the ELKS 8018X CF card reader? |
Sure. It's not a CF, but rather an SD card. Here's the link to the EasyEDA project for my entire SBC, but I'll comment on what I did. I've used a cheap Arduino SD card adapter (the one that has a 3V3 regulator but it doesn't have any voltage level translators). It's wired as follows: You need to be able to drive the SCLK, MOSI and /CS; while you should be able to "read" the MISO. Since the 80C188EB runs at 5V, and since I didn't want to use a voltage level translator, I just added some resistors in series with each pin where the CPU "talks to" (i.e. drives these pins). On the module itself, you have some resistors acting as "pull ups" (not sure why), so I removed them and converted to pull downs (I think I used 1.5K, but using 1K should suffice, it'll get 2.5V for the IO). Nonetheless, the only output signal from the SD card goes straight to the CPU because the CPU recognizes 3V3 as a high value (i.e. a 1). Hope this helps! |
@cocus Thanks for the information... sadly, the link to your project doesn't work (it just loads the home page), even when I'm logged in. |
|
@cocus thank you, appreciate the link. Will take some time to go through it. :) |
Please let me know. I don't think you'd need all of the stuff I added on that schematic. Mostly because some of those were chips that I had laying around, or were things I wanted to test (hence why you'd see a lot of 0ohm resitors scattered around). |
That's pretty cool @cocus that you got ELKS running on hardware that you designed, I didn't realize that! :) Did you use the ADC for anything interesting? And what is the "Arduino module", is that additional Arduino-based hardware, outside this SBC, required for the SD access? |
I'm guessing he's using a module like: https://www.aliexpress.com/item/1005004916894706.html |
This was the second time I've done a "retro" computer, last one was a Z180 with a CPLD but didn't get much love (lost interest). I actually followed some other SBCs, in particular the one from https://web.archive.org/web/20200229050813/kswichit.com/C188/c188sbc.htm (The site was up before, but not now, so I had to use web.archive.org, really sad!).
I've tried to use the ADC by poking it from basic, seems to have worked, but really cumbersome. That ADC came from the same modem I took the chips from, so it's not intended for general purpose, rather for high speed signal acquisition. |
Hi @ghaerr Given a 1MB address space, and the desire to load ELKS (kernel+system) from ROM, what is the ideal address space layout on the 8086 family of processors? What do existing ROM-based systems do? It says somewhere that ROM-based systems only need 128k. What does the address space look like in these instances? The reason I'm asking is that we're looking at how to map RAM/ROM and what configuration would work best for ELKS. We have the ability to map stuff dynamically on our prototype, but that might not be of any use after boot. Thanks! |
Hello @fhendrikx, The 8018x port is booted from ROM, which might be a good place to start for your design, as it is quite similar. The configuration file for it is
The exact layout and boot process of ELKS in ROM is a bit complicated to explain, you'll also want to refer to elks/arch/i86/boot/setup.S and look for The quick answer to your question is that the 8018X 64-128k ROM starts at hardware address 0xE0000 and contains the ELKS kernel code segment, while the data segment starts at hardware address 0x00000 with the ELKS kernel data segment at 0x00600. The RAM can be as small as 128k and I think the kernel can be made to fit in 64k ROM. You can build the 8018x version by copying 8018x.config to .config and running make. It can be emulated by using the EMU86 8086 emulator using the ELKS-provided shell script [EDIT: Actually I think EMU86 won't emulate the 8018X port, as the hardware PIC and PIT are different than IBM PC. Instead, use the Thank you! |
Thank you for that detailed explanation, really appreciated. |
Description
Hi, Following the instructions given here:
https://github.com/ghaerr/elks/blob/master/BUILD.md
When I select the option to build a ROM, the compile fails with an error about undeclared elements. However, as far as I can tell, these are in the linuxmt/config.h file, and this is included in the init/main.c file.
How to reproduce ?
Enabled the option to build a ROM in the menuconfig (Kernel Settings > Build kernel as ROM bootable).
Raw data
The compiler says:
Additional information
Both of these values are defined in the config: ./elks/include/linuxmt/config.h
This is included in the file in question, so everything should work.
Thanks
The text was updated successfully, but these errors were encountered: