Live data from Hacker News

Wozmon for x86-64

github.com

21–30 of 32 posts

Re: Wozmon for x86-64

#22

What a coincidence. I recently converted the 6502 version to Python and then worked with ChatGPT to convert the Python to C. (I'm not a C programmer.) https://github.com/gabrielsroka/gabrielsroka.github.io/tree/...

To support running code you'll need to call mprotect(2) on the buffer to make it executable.

If you hit Ctrl-d on this code it will burn through that loop constantly with no input. You need to check fgets()'s return code, it will be NULL on error or eof.

Re: Wozmon for x86-64

#24
post #20

wozmon.sh run will start Wozmon in a QEMU virtual machine. Does it also run without the virtual machine?

From the author's BareMetal exokernel repository:

> Key features

> [...]

> Physical and virtual hardware support with full virtualization, using x86 hardware virtualization whenever available (it is on most modern x86-64 CPU's). In principle BareMetal should run on any x86-64 hardware platform, even on a physical x86-64 computer, given appropriate drivers. Officially, we develop on QEMU and VirtualBox, which means that you can run BareMetal on both Linux, Microsoft Windows, and Apple macOS.

There's no indication of specific real-world testing, though.

Re: Wozmon for x86-64

#25

I understand what this is. What I don't understand is what is the purpose of doing it.

It is wildly impractical to not have an OS and have to manually program your computer every time you boot it. But don't you want to try it?

Re: Wozmon for x86-64

#26

What a coincidence. I recently converted the 6502 version to Python and then worked with ChatGPT to convert the Python to C. (I'm not a C programmer.) https://github.com/gabrielsroka/gabrielsroka.github.io/tree/...

Interesting to see it written in higher-level languages!

Re: Wozmon for x86-64

#27

What a coincidence. I recently converted the 6502 version to Python and then worked with ChatGPT to convert the Python to C. (I'm not a C programmer.) https://github.com/gabrielsroka/gabrielsroka.github.io/tree/...

To support running code you'll need to call mprotect(2) on the buffer to make it executable. If you hit Ctrl-d on this code it will burn through that loop constantly with no input. You need to check fgets()'s return code, it will be NULL on error or eof.

Thank you. I saw a warning about that from the compiler. But like I said I'm not a C programmer. Feel free to submit a PR if you like.

I assume you're talking about Linux/Unix. I'm mostly a Windows guy.

Re: Wozmon for x86-64

#28

Earlier quoted context omitted.

To support running code you'll need to call mprotect(2) on the buffer to make it executable. If you hit Ctrl-d on this code it will burn through that loop constantly with no input. You need to check fgets()'s return code, it will be NULL on error or eof.

Thank you. I saw a warning about that from the compiler. But like I said I'm not a C programmer. Feel free to submit a PR if you like. I assume you're talking about Linux/Unix. I'm mostly a Windows guy.

I am knowledgeable about both. Unix guy at heart but used to work for MSFT on windows.

The Windows version of mprotect(2) is VirtualProtect. It would probably make more sense to allocate the buffer with VirtualAlloc with the correct flags, rather than modify a stack buffer. The Unix version of that would be to allocate with mmap(2).

Edit: https://github.com/gabrielsroka/gabrielsroka.github.io/pull/...

Re: Wozmon for x86-64

#29
post #20

wozmon.sh run will start Wozmon in a QEMU virtual machine. Does it also run without the virtual machine?

Why would it not?

Should have been more specific, can I run it on Linux or Windows and mess with the memory content? So why not? Because of dependencies on BareMetal or having to overcome the isolation build into the operating system it runs on top of.

Re: Wozmon for x86-64

#30
I remember vapor locking on figuring out addresses in hand assembled 6809 machine code in middle school. It was amazing what Woz pulled off with this. I wish I knew that the apple ii plusses in the computer lab probably had something like wozmon on them.
Post reply on HN