-
Notifications
You must be signed in to change notification settings - Fork 69
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
v86 compatibility. #13
Comments
Update: I fixed the issue by loading it as a floppy image instead. However, I want to know how I can send the files over serial manually instead of through |
This is a pretty cool idea! I'd be more than happy to add a little interactive app to my website and give you attribution. Honestly, I'm not sure the best way. I selected serial port because that was just a simple way to work with QEMU. Other "sector languages" (sectorforth and sectorlisp) drop you into a REPL, IIRC. C traditionally never had a REPL so that felt inappropriate. I'm happy to advise on other approaches to do I/O if the serial interface can't be made to work. FWIW I'm not very familiar with v86 and what capabilities it provides. |
"x86 virtualization in your browser, recompiling x86 to wasm on the fly" I haven't dug that deep but reading between the lines, it looks like the goal is targeted at modern x86 software? SectorC is 16-bit real mode code that leans on the Bios a bit. However, it's not a lot. The compiler itself uses hardly any of it. The examples use a lot it and the original IBM hardware emulation (this is mostly because it makes the examples more fun: who doesn't love graphics and audio! 😁) So there's a couple avenues to explore: (1) add a few small bits of bios support, (2) get a full bios from some other project (e.g. dosbox), (3) rip out the bios parts from SectorC (which means that you probably loose the cool example code) Personally I think having SectorC able to use these bios functions to be a big part of what makes it fun. You could do a lot with a little code on these early machines. Modern machines instead require big long complicated boiler-plate setup routines before you can do anything interesting with the hardware. Having to do that is SectorC's dialect of C would be not fun. |
I understand the use of serial instead of something like a REPL. I have an idea, but im not sure if it would be possible, so I'll wait. I have a question about how it receives input. Does it fail if it doesn't receive input immediately? And when does it know when there is no more code? Is there a character that gets sent that indicates the end of the code? |
It keeps retrying serial read until it gets a character. It stops compiling when it finishes compiling the _start() function. And then it jumps into the compiled code. You could.. in theory then build a stage2 compiler for x86-64 and read that source in next (but I haven't done that) Currently it just ignores whatever follows the _start() function. |
Thanks. This should help me get it working in v86. Also, v86 does support 16-bit real mode. All modern computers (including 64-bit) require it, so v86 requires it as well, meaning |
Oh, excellent! Keep me in the loop. I'm excited to see this working!! |
While I'm working on this, I'm going to present my idea. My idea was to let the user type in (through PS/2) all the C code to compile. Then when they input something like CTRL+S, it'll compile and run. |
You can do that. But be aware that the compiler does basically no error checking. One small typo leads to issues. You might consider running the "lint" app on the web front end to improve the user experience. |
Are you saying that the website would have an editor that creates the files and sends them over serial to the compiler? |
What I'm saying is that it'll be incredibly hard (as a user) to use it directly from the keyboard. That's why I didn't do it that way originally. I have a hard enough time in ordinary C avoiding syntax errors. Compilers are very good at diagnostics. SectorC is Very Bad at diagnostics. |
I see where you are going with this now. I don't know why I didn't originally see this. Sorry, sometimes I'm just really dumb. I'll get to working on this. |
In theory, this should be working. However, nothing seems to be happening. I'm not sure why. I'll upload all the files required for running this in case you would like to experiment. |
Could you put it in a git repo somewhere? I’m careful to avoid random files
from email. You can just create a branch in the SectorC repo if you like.
…On Tue, Aug 8, 2023 at 2:06 PM zap8600 ***@***.***> wrote:
In theory, this should be working. However, nothing seems to be happening.
I'm not sure why. I'll upload all the files required for running this in
case you would like to experiment.
sectorc.zip
<https://github.com/xorvoid/sectorc/files/12295017/sectorc.zip>
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOKLWCUXR7PRT5ZYAEPBBNLXUKE47ANCNFSM6AAAAAA3HDKKIY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I understand. I forked the repo and made a |
The serial send function isn't working with it: A simple test with a simple x86-16 program:
The program hangs after writing an |
I'll make an issue about this. |
I think we might need to add a listener like this. |
I would like to boot
sectorc
in the web with v86, but it can't read the image when loading as a hard drive. Is there any way to putsectorc.bin
into a.img
file?The text was updated successfully, but these errors were encountered: