rust-kernel | A toy kernel in rust | Interpreter library
kandi X-RAY | rust-kernel Summary
kandi X-RAY | rust-kernel Summary
A toy kernel in rust
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rust-kernel
rust-kernel Key Features
rust-kernel Examples and Code Snippets
Community Discussions
Trending Discussions on rust-kernel
QUESTION
I was trying to add keyboard interaction to code from this example. Consider the following files:
...Cargo.toml
ANSWER
Answered 2019-Feb-17 at 07:13I'd like to explain zx485's comment in more detail:
I've often seen that assembly language beginners are confused about what instructions like int
(x86), syscall
(MIPS) or SWI
(ARM) actually do.
Actually, these instructions are a special form of call
instruction: They call some sub-routine which is typically located in the operating system.
64-bit x86 CPUs have different operating modes. One of them is named "real mode". In this mode the CPU can only execute 16-bit code.
The BIOS sub-routine that can be called using int 0x16
only works when the PC is operating in "real mode".
The fact that your program is a 64-bit program (registers like rax
are used) tells us that your CPU is not running in real mode.
If you are writing your own operating system, you can define own sub-routines that are called by certain int
instructions:
You can define a sub-routine that is called by int 0x16
which reads the keyboard and another one called by int 0x10
writing to the screen.
However, you are also free to define that int 0x16
is used for writing to the screen and int 0x10
is used for hard disk access in your operating system.
And in every case you'll have to write the sub-routines yourself because the existing sub-routines in the BIOS cannot be used in any other operating mode than "real mode". (This is what Ross Ridge is indicating in his comment.)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rust-kernel
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page