Coder Social home page Coder Social logo

amoldhamale1105 / frostbyte Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 946 KB

A baremetal lightweight kernel and OS

License: GNU General Public License v3.0

Makefile 5.45% Assembly 20.77% C 73.79%
aarch64 contributions-welcome kernel kernel-development operating-system qemu raspberry-pi raspberry-pi-3 raspberry-pi-4

frostbyte's People

Contributors

amoldhamale1105 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

frostbyte's Issues

Serial console unresponsive on pressing arrow keys

The serial console of the kernel becomes completely unresponsive when any of the arrow keys on the keyboard are pressed. This is not an issue in the uart interrupt handler of the kernel but the uart interrupt itself does not get generated by qemu

To reproduce the issue:

  • Build the kernel using the instructions in Readme.md and run it
  • Try entering some usual commands like ls or ps
  • Press any of the arrow keys (Up, Down, Left, Right)

The console becomes unresponsive.

Keyboard arrow keys not working correctly on raspberry pi 4

The UART module does not process arrow (UP, DOWN, LEFT and RIGHT) and other multi-code keys correctly on raspberry pi 4. Such keys function correctly on qemu.

Analysis of the issue

With reference to BCM2711 TRM, when FIFO is disabled by clearing the FEN bit in the LCRH register, FIFO's become just 1-byte deep holding registers for incoming characters from the keyboard. Arrow keys are combination of three 1-byte long ASCII codes for each direction. In qemu, by reading the flags register and extracting a character until RXFE bit is set (RX FIFO non-empty) in a while loop gives correct sequence of characters in the key buffer. However, this approach does not work consistently on hardware. Sometimes only the first character is captured, other times the first two and so on. This undermines the backend developed for arrow keys in the shell program which expects 3 characters in sequence for a given direction key.
On the other hand, when FIFO is enabled by setting the FEN bit, the minimum level configurable via the IFLS register is 4 (1/8th of 32-byte FIFO) which means that the UART interrupt won't be fired until at least 4 characters are sent by the keyboard. This causes serious limitations to the working of the shell as no feedback is seen on the screen until 4 keys are pressed. The interrupt doesn't seem to be configurable for every character inserted into the FIFO buffer, otherwise this would have been the ideal solution for this problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.