-
Notifications
You must be signed in to change notification settings - Fork 2
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
Starting elksdoom #2
Comments
Wow!!!!!!!!!!!!!!!!!!!! It is working the elksdemo.os2 pre-release 1 on a x86 pentium emulator. I see in-game in color. What I did in
I copied elksdoom to / in a hdd image. Here is the image to try it: It is working with emulator https://copy.sh/v86. Sometimes it fails. Either it halts or it prints out of memory, but it works. |
It also works in Box86 emulator. I used NEC 8088 at 16MHz. |
@FrenkelS What mode of optimization do you use for the compiler? Or currently you avoid optimizations? |
Everything is compiled using 8086 instructions and optimized for the smallest size, except the drawing routines. Those are optimized for speed. https://github.com/FrenkelS/elksdoom/blob/main/compelks.sh:
|
I made a new hdd image with release v20240831: |
I also tried Box86 with emulation of Amstrad 1640, 640kb memory, 8086 at 10 MHz (original is at 8MHz), ATI VGA Wonder XL and it is very slow, but you can still walk around and even kill a guard. |
For the memory usage reduction in ELKS @ghaerr has suggested an improvement in /bootopts that can free more memory in the future. Also we can always disable unused services in the kernel such as networking. |
@ghaerr Is this line |
Yes, that can be done manually, but its tricky and requires recompiling the ELKS kernel. My plan is to introduce heap= in /bootopts, along with setting buf=8 cache=4 task=3 file=10 inode=10 heap=xxx in order to use as few resources as possible in the kernel. The final fix involves ELKS releasing its near heap memory to main memory which now requires a recompilation. @toncho11. I ran your hd32 Doom image under QEMU and it comes up and runs! How do you move the cursor around, the arrow keys aren't working for me so its hard to run the menus and move around in the game for me? |
Try clicking on the numlock. Sometimes it works with on and sometimes with off. Not sure if this is an emulator or Doom8088 issue. Does it help? Click until it start working. |
There is no numlock on my Apple MacBook! I'm going to suggest that a version be made that just uses keyboard keys, as adding support for arrow keys is a bit arduous/ |
I use the "Clear" key above 7 on an Apple keyboard on Windows and it works. Maybe if you have a full sized USB Apple keyboard with "Clear" key then it might work. |
Here is a new image with the ghaerr/elks#1993 |
This is with release 20240902 of elksdoom and heap (and other) kernel memory optimizations: |
Thanks for testing with the new minimum kernel options @toncho11! I was wondering whether the game automatically gained new features with new memory, or how that worked. It sounds like right now things are so tight that the game sometimes used to crash. Is there a way to know when we have enough memory for a viable non-crashing game?
What /bootopts line(s) are you using the for min memory configuration, I am curious? I found when I was testing that ELKS itself didn't do too well with < 6 tasks, and tasks are the biggest kernel data segment memory user (~800+ bytes each). But of course now we're only talking a few Kbytes of memory gain, that may not matter for Doom. |
I am using the default line you did in /bootopts with task=6, heap=15000 and also I do init=/elksdoom.os2 |
I just did some testing on x86box on a 386 and I could not make it crash. Others should test as well, but it looks very good! |
@toncho11 thanks for the image. It runs on my 8088 hardware with 1MB RAM at an impressive 15 seconds per frame :) |
Hi @FrenkelS, Does ELKS Doom support CGA, or is it VGA only? Best |
You are probably the first to test on real hardware, so it is good news that it works. There will be some optimizations with time. Also I am not sure if a better vga card will help at all. I tried above with emulation of 20 MHz Amstrad 1640 and I think it was better experience than yours. |
It is running on qemu quite well! Which are the options to have some kind of sound in the game? May be just pc speaker at a start? |
It looks like pc speaker sound effects might be possible |
Cool! Would a Yamaha chip (like OPL3) be hard to program from Elks? |
Yes, user programs under ELKS can play sounds by setting a frequency in channel two of the PIT and then gating the PC speaker on via the keyboard port just like DOS programs do. The kernel uses the same method to produce a bell when a ^G is received.
You'd want to have a sound library of some kind so you don't start from scratch I would think, and the code would then reside within Doom, accessing the OPL3 hardware directly. The original PC Doom used a third-party library for all the sound cards, I'm not sure if there's any Doom source for sound cards for the open source Linux version. |
In DOS Doom, the sound library is also responsible for the timer. Every tick the sound is updated. We're not allowed to change the timer in ELKS. So I'm not sure how to do the sound properly. |
Now that I understand how Doom works on ELKS in a little more detail, I would say that it would be OK to access the PIT directly to change the tick rate to 35ms, if that's what it takes to get sound. On exit, the PIT should be reprogrammed to 10ms. Only the countdown timer has to be changed, the other PIT register can remain untouched. The downside of playing with the PIT is that the |
I've tried to add PC Speaker sound effects without changing the PIT. BTW, in vanilla Doom the ticrate is 35. So every second the timer is increased by 35. In other words, every 28.5ms (=1/35) the timer is increased by 1. |
Very cool having sound! Hearing any sound is great, and I think we should be able to reprogram the PIT on Doom start/exit with no big problems for the ELKS kernel, if only the countdown (timeout) value needs to be changed.
Thanks, I keep confusing the timer tick rate of 1/35 with 35ms, I meant 28.5ms.
Does this mean that when the sound is compiled in for Doom, the PIT is reprogrammed only when sound is played to 7ms, or that Doom runs at 7ms from start? It probably doesn't matter, just wondering what the effect of a changed PIT countdown will be in ELKS during Doom execution. On another note, we can save an additional 9K of RAM if we turn off floppy track caching CONFIG_TRACK_CACHE in .config, which will slow down program load but make more mem available for added features. |
Here I made a summary on how to optimize ELKS for running Elks Doom: https://github.com/ghaerr/elks/wiki/Increase-available-memory |
Hi
I could not run release 1. I do not get an error message. Just the cursor keeps blinking after pressing enter.
Is the release a 8086 build or higher? 286? 386?
What do you do to create a big continuous memory block in ELKS? Do you use any of the optimizations we discussed previously? What is the size of your free memory before starting it when using
meminfo
?I think these are important to put on the front page.
Thank you!
The text was updated successfully, but these errors were encountered: