debugging interpreters with blinkenlights

58 views
Skip to first unread message

R Z

unread,
May 9, 2021, 10:42:24 AM5/9/21
to blinkenlights
Hello Justine,

First of all, I just want to say thank you, you've done incredible work! justine.lol and the projects within it are a treasure.

Quick question. Is there a way to use blinkenlights to debug interpreters? Can I type into stdin from the blinkenlights tui somehow? 

Regards,
Richie

Justine Tunney

unread,
May 9, 2021, 12:23:44 PM5/9/21
to R Z, blinkenlights
Not currently but I want that feature.  https://github.com/jart/cosmopolitan/issues/100

Assume we want to load the /lib/libc.musl-x86_64.so.1 interpreter. We'd need to update cosmopolitan/tool/build/lib/loader.c so it can apply the PT_DYNAMIC fixups to memory after the PT_LOAD segments are copied to memory. That's pretty much it. Once that's done, Blinkenlights should be able to beautifully simulate nearly all the Linux binaries that exist, regardless of what operating system it's run on.

There's only one other potential blocker you might encounter. See cosmopolitan/tool/build/lib/syscall.c We've got most of the Linux SYSCALL ABI covered already. The big one we're missing is the fork function. Adding that wouldn't be as trivial, since it'd likely require TUI elements to monitor the list of simulated processes.

--
You received this message because you are subscribed to the Google Groups "blinkenlights" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blinkenlight...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blinkenlights/3d958db3-9a71-4527-87ff-b0d2281a2f96n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

R Z

unread,
May 9, 2021, 12:25:06 PM5/9/21
to blinkenlights
To add a bit more context, I'm using blinkenlights on windows using cmd.exe I'm having trouble typing into the TELETYPEWRITER section. I can see the letters that I type separated by spaces which is fine, but just can't figure out how to cleanly hit Enter and then continue my program.

R Z

unread,
May 9, 2021, 12:26:50 PM5/9/21
to blinkenlights
Ah I didn't see you replied until after I sent my last message. Thanks for the info!

Justine Tunney

unread,
May 9, 2021, 12:32:08 PM5/9/21
to R Z, blinkenlights
We might need to to update blinkenlights.c so that when it passes along terminal input on windows it translates \r keystrokes to \n

--
You received this message because you are subscribed to the Google Groups "blinkenlights" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blinkenlight...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages