News for hackers. Stuff that matters.
Re:Dusk OS by 90s_dev on Tuesday May 13, 2025 @04:09PM (#43977139)
> https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/io/kbd...

I don't know forth. Is this a driver? How does it talk to the hardware?

Re:Dusk OS by 7thaccount on Tuesday May 13, 2025 @04:22PM (#43977264)
Forth is usually kind of like a macro later on top of Assembly or even machine code in the case of very simple CPUs, although it can be written on top of anything (example: Python). I think a layer on top of C is pretty common these days as the processors keep getting crazy complicated. Another important note is that although there are some conventions, almost everyone rolls their own Forth, so they're all unique in a lot of ways. The old saying is if you've seen one forth, then you've seen one forth. There is an ANS standard, but it isn't used a whole lot to my knowledge.

So I assume it talks to drivers like you would with Assembly? That's just a guess and probably a bad one.

Re:Dusk OS by kjander79 on Tuesday May 13, 2025 @04:24PM (#43977301)
It's just an event loop, watching for status changes in a memory location. Talking to the hardware just occurs when the keyboard changes the values in memory.
Re:Dusk OS by skupig on Tuesday May 13, 2025 @04:32PM (#43977374)
The USB host code is in fs/drv/usb: https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/drv/us...

Not that I can read any of it... Forth looks unlike any other language I've ever seen o_O