sys_yield tests worked on qemu.

This commit is contained in:
Yifan Wu 2020-11-29 04:01:38 +08:00
parent 3f3e6b2b99
commit adbe671fe1
10 changed files with 134 additions and 53 deletions

View file

@ -18,4 +18,6 @@ binary: elf
build: binary
clean:
@cargo clean
@cargo clean
.PHONY: elf binary build clean

View file

@ -6,11 +6,14 @@ extern crate user_lib;
use user_lib::sys_yield;
const WIDTH: usize = 10;
const HEIGHT: usize = 5;
#[no_mangle]
fn main() -> i32 {
for _ in 0..3 {
for _ in 0..10 { print!("A"); }
println!("");
for i in 0..HEIGHT {
for _ in 0..WIDTH { print!("A"); }
println!(" [{}/{}]", i + 1, HEIGHT);
sys_yield();
}
println!("Test write_a OK!");

View file

@ -6,13 +6,16 @@ extern crate user_lib;
use user_lib::sys_yield;
const WIDTH: usize = 10;
const HEIGHT: usize = 2;
#[no_mangle]
fn main() -> i32 {
for _ in 0..3 {
for _ in 0..10 { print!("B"); }
println!("");
for i in 0..HEIGHT {
for _ in 0..WIDTH { print!("B"); }
println!(" [{}/{}]", i + 1, HEIGHT);
sys_yield();
}
println!("Test write_b OK!");
0
}
}

View file

@ -6,13 +6,16 @@ extern crate user_lib;
use user_lib::sys_yield;
const WIDTH: usize = 10;
const HEIGHT: usize = 3;
#[no_mangle]
fn main() -> i32 {
for _ in 0..3 {
for _ in 0..10 { print!("C"); }
println!("");
for i in 0..HEIGHT {
for _ in 0..WIDTH { print!("C"); }
println!(" [{}/{}]", i + 1, HEIGHT);
sys_yield();
}
println!("Test write_c OK!");
0
}
}