Skip to content

Adds standard-input. - #57

Merged
jonathanpallant merged 7 commits into
developfrom
add-stdin
Jul 21, 2023
Merged

jonathanpallant merged 7 commits into
developfrom
add-stdin

Conversation

@thejpster

Copy link
Copy Markdown
Member

It's not nice, because I put the keyboard decoding into a static mut. Really, this should be in a mutex. But to make a mutex you need compare-and-swap, and ARMv6-M doesn't have that, and the work-around is very hardware specific.

So, I think we need a critical-section implementation for the OS which uses the BIOS to acquire and release the lock. We can then use atomic-polyfill to provide compare-and-swap as we do on the Neotron Pico BIOS.

Also I lost the serial input because that's currently in the menu context and we can't access that from OS API callbacks.

It's not nice, because I put the keyboard decoding into a static mut. Really, this should be in a mutex. But to make a mutex you need compare-and-swap, and ARMv6-M doesn't have that, and the work-around is very hardware specific.

So, I think we need a critical-section implementation for the OS which uses the BIOS to acquire and release the lock. We can then use atomic-polyfill to provide compare-and-swap as we do on the Neotron Pico BIOS.

Also I lost the serial input because that's currently in the menu context and we can't access that from OS API callbacks.
Removes a bunch of static mut stuff. Does require the BIOS to implement compare-and-swap for us, because the CPU might not have it.

Ran out of code space so I had to make the memory allocations larger. I think we now no-longer fit on a Neotron 32.
Comment thread src/refcell.rs Outdated
@jonathanpallant jonathanpallant changed the title Draft: Adds standard-input. Adds standard-input. Jul 21, 2023
@jonathanpallant

Copy link
Copy Markdown
Contributor

Tested OK on Neotron Pico BIOS and Neotron QEMU BIOS.

@jonathanpallant

Copy link
Copy Markdown
Contributor

Standard input tested with new sample program.

@jonathanpallant
jonathanpallant merged commit 694b9d8 into develop Jul 21, 2023
@thejpster
thejpster deleted the add-stdin branch July 22, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants