forked from AbleOS/ableos
compiling on arm works again
This commit is contained in:
parent
5fba1eb890
commit
195192db8a
|
@ -109,8 +109,17 @@ pub fn handler(vm: &mut Vm) {
|
||||||
info!("Recieve {:?} from Buffer({})", msg, r2);
|
info!("Recieve {:?} from Buffer({})", msg, r2);
|
||||||
}
|
}
|
||||||
5 => {
|
5 => {
|
||||||
let r2 = vm.registers[2].cast::<u64>();
|
#[cfg(target_arch = "x86_64")]
|
||||||
vm.registers[3] = hbvm::value::Value( unsafe { x86_in(r2 as u16) } as u64);
|
{
|
||||||
|
let r2 = vm.registers[2].cast::<u64>();
|
||||||
|
unsafe fn x86_in(address: u16) -> u32 {
|
||||||
|
x86_64::instructions::port::Port::new(address).read()
|
||||||
|
}
|
||||||
|
unsafe fn x86_out(address: u16, value: u32) {
|
||||||
|
x86_64::instructions::port::Port::new(address).write(value);
|
||||||
|
}
|
||||||
|
vm.registers[3] = hbvm::value::Value(unsafe { x86_in(r2 as u16) } as u64);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 5
|
// 5
|
||||||
_ => {
|
_ => {
|
||||||
|
@ -119,13 +128,6 @@ pub fn handler(vm: &mut Vm) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn x86_in(address: u16) -> u32{
|
|
||||||
x86_64::instructions::port::Port::new(address).read()
|
|
||||||
}
|
|
||||||
unsafe fn x86_out(address: u16, value: u32){
|
|
||||||
x86_64::instructions::port::Port::new(address).write(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn log_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> {
|
fn log_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> {
|
||||||
// let message_length = 8 + 8 + 8;
|
// let message_length = 8 + 8 + 8;
|
||||||
// log::info!("Mem Addr 0x{:x?} length {}", mem_addr, length);
|
// log::info!("Mem Addr 0x{:x?} length {}", mem_addr, length);
|
||||||
|
@ -139,7 +141,7 @@ fn log_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogE
|
||||||
}
|
}
|
||||||
let log_level = msg_vec.pop().unwrap();
|
let log_level = msg_vec.pop().unwrap();
|
||||||
match String::from_utf8(msg_vec) {
|
match String::from_utf8(msg_vec) {
|
||||||
Ok (strr) => {
|
Ok(strr) => {
|
||||||
// use LogLevel::*;
|
// use LogLevel::*;
|
||||||
let ll = match log_level {
|
let ll = match log_level {
|
||||||
0 | 48 => error!("{}", strr),
|
0 | 48 => error!("{}", strr),
|
||||||
|
|
|
@ -28,7 +28,7 @@ TERM_BACKDROP=008080
|
||||||
MODULE_CMDLINE=""
|
MODULE_CMDLINE=""
|
||||||
|
|
||||||
MODULE_PATH=boot:///keyboard_driver.hbf
|
MODULE_PATH=boot:///keyboard_driver.hbf
|
||||||
MODULE_CMDLINE=""
|
MODULE_CMDLINE="arch=${ARCH}"
|
||||||
|
|
||||||
MODULE_PATH=boot:///vfs_test.hbf
|
MODULE_PATH=boot:///vfs_test.hbf
|
||||||
MODULE_CMDLINE=""
|
MODULE_CMDLINE=""
|
||||||
|
|
|
@ -29,7 +29,6 @@ fn ipc_make_bound_buffer(length) {
|
||||||
private fn log(log_level, string){
|
private fn log(log_level, string){
|
||||||
// This is NOT the final format
|
// This is NOT the final format
|
||||||
let str = data::str(string + log_level);
|
let str = data::str(string + log_level);
|
||||||
|
|
||||||
// 1 byte for the log level
|
// 1 byte for the log level
|
||||||
// 8 bytes for the length to the message
|
// 8 bytes for the length to the message
|
||||||
// 8 bytes for the pointer to the string
|
// 8 bytes for the pointer to the string
|
||||||
|
|
|
@ -72,7 +72,7 @@ fn clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define main
|
// Define main
|
||||||
fn main(){
|
fn main() {
|
||||||
// Log the arguments
|
// Log the arguments
|
||||||
{
|
{
|
||||||
cp(r3, r1);
|
cp(r3, r1);
|
||||||
|
|
Loading…
Reference in a new issue