Compare commits
17 commits
Author | SHA1 | Date | |
---|---|---|---|
Able | d609e6d78c | ||
Able | 77e6f29568 | ||
Able | b7c9feff26 | ||
Able | 7f8a7e92a5 | ||
Able | 40bd10d7af | ||
Able | fde952a383 | ||
Able | 6d74772961 | ||
Able | 118c2edfc1 | ||
Able | 04374aa905 | ||
Able | 7785de8fd9 | ||
Able | 706c17c74f | ||
2780afd1e1 | |||
4dc0b92778 | |||
75b6fec5ab | |||
Able | 20b9947a88 | ||
Able | cb8365abbd | ||
Able | 27698842da |
21
ableos/Cargo.lock
generated
21
ableos/Cargo.lock
generated
|
@ -52,6 +52,7 @@ dependencies = [
|
|||
"vga",
|
||||
"volatile 0.2.7",
|
||||
"wasmi",
|
||||
"x86",
|
||||
"x86_64",
|
||||
"y-compositor-protocol",
|
||||
]
|
||||
|
@ -418,6 +419,15 @@ version = "0.6.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
|
||||
|
||||
[[package]]
|
||||
name = "raw-cpuid"
|
||||
version = "10.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "929f54e29691d4e6a9cc558479de70db7aa3d98cd6fe7ab86d7507aa2886b9d2"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rdrand"
|
||||
version = "0.8.1"
|
||||
|
@ -727,6 +737,17 @@ dependencies = [
|
|||
"parity-wasm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "x86"
|
||||
version = "0.46.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6297379090b1be212a2d59dd57708c99b42b4bcbeee2ce6fb80babbe7b63e89a"
|
||||
dependencies = [
|
||||
"bit_field",
|
||||
"bitflags",
|
||||
"raw-cpuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "x86_64"
|
||||
version = "0.14.7"
|
||||
|
|
|
@ -9,11 +9,11 @@ panic = "abort"
|
|||
|
||||
[package.metadata.bootimage]
|
||||
run-args = [
|
||||
"-cpu",
|
||||
# "-cpu",
|
||||
# "kvm64-v1",
|
||||
# Support for rdrand
|
||||
# "Broadwell",
|
||||
"EPYC-v1",
|
||||
# "EPYC-v1",
|
||||
|
||||
|
||||
"-serial",
|
||||
|
@ -50,9 +50,8 @@ log = "*"
|
|||
pretty-hex = "0.2.1"
|
||||
unicode-width = "0.1.7"
|
||||
picorand = "*"
|
||||
x86 = "*"
|
||||
# watson = "0.4"
|
||||
uefi = { version="*", features = ["exts"] }
|
||||
|
||||
|
||||
[dependencies.rdrand]
|
||||
version = "0.8.1"
|
||||
|
@ -118,3 +117,8 @@ pic8259 = "0.10.1"
|
|||
uart_16550 = "0.2.0"
|
||||
volatile = "0.2.6"
|
||||
x86_64 = "*"
|
||||
|
||||
|
||||
|
||||
[target.'cfg(target_os = "uefi")'.dependencies]
|
||||
uefi = { version="*",default-features = false, features = ["exts"] }
|
||||
|
|
|
@ -17,9 +17,11 @@ static ALLOCATOR: Dummy = Dummy;
|
|||
*/
|
||||
use linked_list_allocator::LockedHeap;
|
||||
|
||||
// #[cfg(not(target_os = "uefi"))]
|
||||
#[global_allocator]
|
||||
pub static ALLOCATOR: LockedHeap = LockedHeap::empty();
|
||||
|
||||
// #[cfg(not(target_os = "uefi"))]
|
||||
#[alloc_error_handler]
|
||||
fn alloc_error_handler(layout: alloc::alloc::Layout) -> ! {
|
||||
panic!("allocation error: {:?}", layout)
|
||||
|
|
BIN
ableos/src/arch/uefi_86/firmware/OVMF-pure-efi.fd
Normal file
BIN
ableos/src/arch/uefi_86/firmware/OVMF-pure-efi.fd
Normal file
Binary file not shown.
1
ableos/src/arch/uefi_86/init.rs
Normal file
1
ableos/src/arch/uefi_86/init.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub fn init() {}
|
128
ableos/src/arch/uefi_86/mod.rs
Normal file
128
ableos/src/arch/uefi_86/mod.rs
Normal file
|
@ -0,0 +1,128 @@
|
|||
pub mod init;
|
||||
|
||||
pub fn shutdown() {
|
||||
loop {}
|
||||
}
|
||||
|
||||
pub fn sloop() -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
use crate::kmain::kernel_main;
|
||||
|
||||
use uefi::{
|
||||
prelude::*,
|
||||
proto::console::gop::{GraphicsOutput, PixelFormat},
|
||||
};
|
||||
use uefi::{proto::console::gop::FrameBuffer, ResultExt};
|
||||
|
||||
#[entry]
|
||||
fn main(_handle: Handle, mut system_table: SystemTable<Boot>) -> Status {
|
||||
system_table
|
||||
.stdout()
|
||||
.reset(false)
|
||||
.expect_success("Failed to reset output buffer");
|
||||
// uefi_services::init(&mut system_table).unwrap_success();
|
||||
|
||||
{
|
||||
// Print out UEFI revision number
|
||||
let rev = system_table.uefi_revision();
|
||||
let (major, minor) = (rev.major(), rev.minor());
|
||||
|
||||
info!("UEFI {}.{}", major, minor);
|
||||
}
|
||||
|
||||
info!("Running graphics output protocol test");
|
||||
|
||||
let stdout = system_table.stdout();
|
||||
|
||||
stdout.set_cursor_position(0, 10).unwrap_success();
|
||||
info!("{:?}", stdout.cursor_position());
|
||||
|
||||
if let Ok(gop) = system_table
|
||||
.boot_services()
|
||||
.locate_protocol::<GraphicsOutput>()
|
||||
{
|
||||
let gop = gop.expect("Warnings encountered while opening GOP");
|
||||
let gop = unsafe { &mut *gop.get() };
|
||||
let mode = gop
|
||||
.modes()
|
||||
.map(|mode| mode.expect("Warnings encountered while querying mode"))
|
||||
.find(|mode| {
|
||||
let info = mode.info();
|
||||
info.resolution() == (1440, 900)
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
gop.set_mode(&mode)
|
||||
.expect_success("Failed to set graphics mode");
|
||||
|
||||
let mut fb_1 = FrameBuffWrap::new(gop);
|
||||
|
||||
for x in 0..100 {
|
||||
fb_1.draw_pixel(x, 400, [123, 123, 123]);
|
||||
}
|
||||
} else {
|
||||
// No tests can be run.
|
||||
warn!("UEFI Graphics Output Protocol is not supported");
|
||||
}
|
||||
|
||||
// exit boot services
|
||||
kernel_main();
|
||||
}
|
||||
|
||||
use uefi::proto::console::gop::ModeInfo;
|
||||
|
||||
pub type PixelWriter = unsafe fn(&mut FrameBuffer, usize, [u8; 3]);
|
||||
pub struct FrameBuffWrap<'a> {
|
||||
inner: FrameBuffer<'a>,
|
||||
|
||||
mode_info: ModeInfo,
|
||||
|
||||
pub resolution: (usize, usize),
|
||||
}
|
||||
|
||||
impl<'b: 'c, 'c> FrameBuffWrap<'c> {
|
||||
pub fn new(gop: &'c mut GraphicsOutput<'c>) -> Self {
|
||||
let mi = gop.current_mode_info();
|
||||
let res = mi.resolution();
|
||||
|
||||
Self {
|
||||
inner: gop.frame_buffer(),
|
||||
mode_info: mi,
|
||||
resolution: res,
|
||||
}
|
||||
}
|
||||
unsafe fn write_pixel_rgb(&mut self, pixel_base: usize, rgb: [u8; 3]) {
|
||||
self.inner.write_value(pixel_base, rgb);
|
||||
}
|
||||
unsafe fn write_pixel_bgr(&mut self, pixel_base: usize, rgb: [u8; 3]) {
|
||||
self.inner.write_value(pixel_base, [rgb[2], rgb[1], rgb[0]]);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Sync for FrameBuffWrap<'_> {}
|
||||
unsafe impl Send for FrameBuffWrap<'_> {}
|
||||
|
||||
pub trait GraphicsAPI {
|
||||
fn draw_pixel(&mut self, x: usize, y: usize, color: [u8; 3]);
|
||||
}
|
||||
|
||||
impl GraphicsAPI for FrameBuffWrap<'_> {
|
||||
fn draw_pixel(&mut self, x: usize, y: usize, color: [u8; 3]) {
|
||||
let pixel_base = (y * self.mode_info.stride()) + x;
|
||||
|
||||
match self.mode_info.pixel_format() {
|
||||
PixelFormat::Rgb => unsafe {
|
||||
self.write_pixel_rgb(pixel_base, color);
|
||||
},
|
||||
PixelFormat::Bgr => unsafe {
|
||||
self.write_pixel_bgr(pixel_base, color);
|
||||
},
|
||||
_ => {
|
||||
info!("This pixel format is not supported by the drawing demo");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
pub mod absi;
|
||||
// pub mod absi;
|
||||
pub mod clip;
|
||||
pub mod futex;
|
||||
pub mod info;
|
||||
|
@ -10,4 +10,7 @@ pub mod server;
|
|||
pub mod systeminfo;
|
||||
pub mod virtual_memory;
|
||||
pub mod y_compositor;
|
||||
|
||||
pub mod vterm;
|
||||
|
||||
pub const BANNER: &str = include_str!("banner.txt");
|
||||
|
|
172
ableos/src/experiments/vterm.rs
Normal file
172
ableos/src/experiments/vterm.rs
Normal file
|
@ -0,0 +1,172 @@
|
|||
use core::ops::Not;
|
||||
|
||||
use shadeable::pixel_format::Rgba64;
|
||||
|
||||
pub const VTERM_HEIGHT: u32 = 40;
|
||||
pub const VTERM_WIDTH: u32 = 100;
|
||||
/// Fg and bg colors for vterm
|
||||
pub type ColorCharacter = (Rgba64, Rgba64);
|
||||
|
||||
/// A vterm representation of a character
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct VtermCharacter {
|
||||
pub character: char,
|
||||
//
|
||||
pub style: Style,
|
||||
//
|
||||
pub char_color: ColorCharacter,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Style {
|
||||
pub bold: bool,
|
||||
pub underline: bool,
|
||||
pub italic: bool,
|
||||
pub blink: bool,
|
||||
pub reverse: bool,
|
||||
pub strike: bool,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct StylePacked(pub u8);
|
||||
|
||||
impl StylePacked {
|
||||
pub fn bold(&self) -> bool {
|
||||
(self.0 & 0x01) > 0
|
||||
}
|
||||
pub fn underlined(&self) -> bool {
|
||||
(self.0 & 0x02) > 0
|
||||
}
|
||||
pub fn italic(&self) -> bool {
|
||||
(self.0 & 0x04) > 0
|
||||
}
|
||||
pub fn blinking(&self) -> bool {
|
||||
(self.0 & 0x08) > 0
|
||||
}
|
||||
pub fn reversed(&self) -> bool {
|
||||
(self.0 & 0x10) > 0
|
||||
}
|
||||
pub fn struck(&self) -> bool {
|
||||
(self.0 & 0x20) > 0
|
||||
}
|
||||
#[must_use]
|
||||
pub fn set_bold(mut self, v: bool) -> Self {
|
||||
if v {
|
||||
self.0 |= 0x01;
|
||||
} else {
|
||||
self.0 &= 0x01u8.not();
|
||||
}
|
||||
self
|
||||
}
|
||||
#[must_use]
|
||||
pub fn set_underlined(mut self, v: bool) -> Self {
|
||||
if v {
|
||||
self.0 |= 0x02;
|
||||
} else {
|
||||
self.0 &= 0x02u8.not();
|
||||
}
|
||||
self
|
||||
}
|
||||
#[must_use]
|
||||
pub fn set_italic(mut self, v: bool) -> Self {
|
||||
if v {
|
||||
self.0 |= 0x04;
|
||||
} else {
|
||||
self.0 &= 0x04u8.not();
|
||||
}
|
||||
self
|
||||
}
|
||||
#[must_use]
|
||||
pub fn set_blinking(mut self, v: bool) -> Self {
|
||||
if v {
|
||||
self.0 |= 0x08;
|
||||
} else {
|
||||
self.0 &= 0x08u8.not();
|
||||
}
|
||||
self
|
||||
}
|
||||
#[must_use]
|
||||
pub fn set_reversed(mut self, v: bool) -> Self {
|
||||
if v {
|
||||
self.0 |= 0x10;
|
||||
} else {
|
||||
self.0 &= 0x10u8.not();
|
||||
}
|
||||
self
|
||||
}
|
||||
#[must_use]
|
||||
pub fn set_struck(mut self, v: bool) -> Self {
|
||||
if v {
|
||||
self.0 |= 0x20;
|
||||
} else {
|
||||
self.0 &= 0x20u8.not();
|
||||
}
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Vterm {
|
||||
pub characters: [[VtermCharacter; VTERM_WIDTH as usize]; VTERM_HEIGHT as usize],
|
||||
/// The internal representation of the vterm
|
||||
style: Style,
|
||||
/// The cursor position in layout x,y
|
||||
cursor_position: (u32, u32),
|
||||
|
||||
pub cursor_visible: bool,
|
||||
}
|
||||
|
||||
impl Default for Vterm {
|
||||
fn default() -> Self {
|
||||
Vterm {
|
||||
characters: [[VtermCharacter {
|
||||
character: ' ',
|
||||
char_color: (0xff_ff_ff_ff, 0x00_00_00_00),
|
||||
style: Style {
|
||||
bold: false,
|
||||
underline: false,
|
||||
italic: false,
|
||||
blink: false,
|
||||
reverse: false,
|
||||
strike: false,
|
||||
},
|
||||
}; VTERM_WIDTH as usize]; VTERM_HEIGHT as usize],
|
||||
cursor_position: (0, 0),
|
||||
cursor_visible: true,
|
||||
style: Style {
|
||||
bold: false,
|
||||
underline: false,
|
||||
italic: false,
|
||||
blink: false,
|
||||
reverse: false,
|
||||
strike: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Vterm {
|
||||
pub fn new() -> Self {
|
||||
Vterm::default()
|
||||
}
|
||||
/// Set the vterm cursor to the given position
|
||||
pub fn set_cursor_position(&mut self, x: u32, y: u32) {
|
||||
if x > VTERM_WIDTH {
|
||||
self.cursor_position.0 = VTERM_WIDTH;
|
||||
error!("Cursor x position out of bounds");
|
||||
} else {
|
||||
self.cursor_position.0 = x;
|
||||
}
|
||||
if y > VTERM_HEIGHT {
|
||||
error!("Cursor y position out of bounds");
|
||||
|
||||
self.cursor_position.1 = VTERM_HEIGHT;
|
||||
} else {
|
||||
self.cursor_position.1 = y;
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the vterm style
|
||||
pub fn set_vterm_style(&mut self, style: Style) {
|
||||
self.style = style;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ impl ScreenSize {
|
|||
pub enum GraphicsReturn {
|
||||
Ok,
|
||||
ImproperScreenSize,
|
||||
GenericError,
|
||||
}
|
||||
|
||||
pub struct ScreenBuffer {
|
||||
|
@ -138,10 +139,6 @@ impl ScreenBuffer {
|
|||
/// * `glyph` - the glyph to draw
|
||||
/// * `color` - the color of the glyph
|
||||
pub fn draw_char(&mut self, mut x: u32, mut y: u32, character: char, color: Rgba64) {
|
||||
// trace!["Judy Hopps is thicc af"];
|
||||
// let mode = *VGAE.lock();
|
||||
// trace!["She got them bouncy bunny buns"];
|
||||
|
||||
let basic_multingual_plane = FontRef::try_from_slice(include_bytes!(
|
||||
"../../../ableos/assets/fonts/unifont-14.0.01.ttf"
|
||||
))
|
||||
|
|
1
ableos/src/graphics_api/inputs.rs
Normal file
1
ableos/src/graphics_api/inputs.rs
Normal file
|
@ -0,0 +1 @@
|
|||
|
5
ableos/src/graphics_api/mod.rs
Normal file
5
ableos/src/graphics_api/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
pub mod inputs;
|
||||
pub mod pixel_format;
|
||||
pub mod positions;
|
||||
pub mod text;
|
||||
pub mod window;
|
45
ableos/src/graphics_api/pixel_format.rs
Normal file
45
ableos/src/graphics_api/pixel_format.rs
Normal file
|
@ -0,0 +1,45 @@
|
|||
use core::ops::{BitAnd, BitOr, Shr};
|
||||
|
||||
pub type Rgba = u32;
|
||||
|
||||
pub fn get_r(rgba: Rgba) -> u8 {
|
||||
rgba.bitand(0xff_00_00_00).shr(0o30) as u8
|
||||
}
|
||||
pub fn get_g(rgba: Rgba) -> u8 {
|
||||
rgba.bitand(0xff_00_00).shr(0o20) as u8
|
||||
}
|
||||
|
||||
pub fn get_b(rgba: Rgba) -> u8 {
|
||||
rgba.bitand(0xff_00).shr(0o10) as u8
|
||||
}
|
||||
|
||||
pub fn get_a(rgba: Rgba) -> u8 {
|
||||
(rgba & 0xff) as u8
|
||||
}
|
||||
|
||||
pub fn set_r(rgba: Rgba, r: u8) -> Rgba {
|
||||
rgba.bitand(0x_00_ff_ff_ff).bitor((r as Rgba).shr(0o30))
|
||||
}
|
||||
|
||||
pub fn set_g(rgba: Rgba, g: u8) -> Rgba {
|
||||
rgba.bitand(0xff_00_ff_ff).bitor((g as Rgba).shr(0o20))
|
||||
}
|
||||
|
||||
pub fn set_b(rgba: Rgba, b: u8) -> Rgba {
|
||||
rgba.bitand(0xff_ff_00_ff).bitor((b as Rgba).shr(0o10))
|
||||
}
|
||||
|
||||
pub fn set_a(rgba: Rgba, a: u8) -> Rgba {
|
||||
rgba.bitand(0xff_ff_ff_00).bitor(a as Rgba)
|
||||
}
|
||||
|
||||
pub fn rgba_div(a: Rgba, b: Rgba) -> Rgba {
|
||||
set_r(0, get_r(a) / get_r(b))
|
||||
| set_g(0, get_g(a) / get_g(b))
|
||||
| set_g(0, get_b(a) / get_b(b))
|
||||
| set_g(0, get_a(a) / get_a(b))
|
||||
}
|
||||
|
||||
pub fn new_rgba(r: u8, g: u8, b: u8, a: u8) -> Rgba {
|
||||
set_r(0, r) | set_g(0, g) | set_b(0, b) | set_a(0, a)
|
||||
}
|
23
ableos/src/graphics_api/positions.rs
Normal file
23
ableos/src/graphics_api/positions.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct Position2D {
|
||||
pub x: isize,
|
||||
pub y: isize,
|
||||
}
|
||||
|
||||
impl Position2D {
|
||||
pub fn new(x: isize, y: isize) -> Self {
|
||||
Self { x, y }
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Position3D {
|
||||
pub x: isize,
|
||||
pub y: isize,
|
||||
pub z: isize,
|
||||
}
|
||||
|
||||
impl Position3D {
|
||||
pub fn new(x: isize, y: isize, z: isize) -> Self {
|
||||
Self { x, y, z }
|
||||
}
|
||||
}
|
7
ableos/src/graphics_api/text.rs
Normal file
7
ableos/src/graphics_api/text.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
use super::positions::Position2D;
|
||||
|
||||
use super::pixel_format::Rgba;
|
||||
|
||||
pub type FontSize = u32;
|
||||
|
||||
pub fn draw_char(position: Position2D, character: char, size: FontSize, color: Rgba) {}
|
38
ableos/src/graphics_api/window.rs
Normal file
38
ableos/src/graphics_api/window.rs
Normal file
|
@ -0,0 +1,38 @@
|
|||
use super::positions::Position2D;
|
||||
use alloc::string::{String, ToString};
|
||||
|
||||
/// NOTE: If this is a zero then no framebuffer has been created for this window.
|
||||
pub type FrameBufferID = u16;
|
||||
|
||||
pub struct Window {
|
||||
pub title: String,
|
||||
pub resolution: Resolution,
|
||||
pub position: Position2D,
|
||||
pub is_fullscreen: bool,
|
||||
pub framebuffer_id: FrameBufferID,
|
||||
|
||||
pub cursor_position: Position2D,
|
||||
}
|
||||
|
||||
impl Window {
|
||||
pub fn set_title(&mut self, title: &str) {
|
||||
self.title = title.to_string();
|
||||
}
|
||||
pub fn get_cursor_position(&self) -> Position2D {
|
||||
self.cursor_position
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Resolution {
|
||||
pub width: usize,
|
||||
pub height: usize,
|
||||
}
|
||||
|
||||
pub enum CursorType {
|
||||
Arrow,
|
||||
IBeam,
|
||||
Crosshair,
|
||||
Hand,
|
||||
HResize,
|
||||
VResize,
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
#![allow(clippy::empty_loop)]
|
||||
|
||||
use x86_64::instructions::random::RdRand;
|
||||
|
||||
use crate::{logger, vterm::Vterm};
|
||||
use {
|
||||
crate::{
|
||||
arch::{init, sloop},
|
||||
|
@ -13,7 +16,8 @@ use {
|
|||
file::PathRep,
|
||||
relib::network::socket::{SimpleSock, Socket},
|
||||
scheduler::SCHEDULER,
|
||||
VgaBuffer, SCREEN_BUFFER,
|
||||
// VgaBuffer,
|
||||
SCREEN_BUFFER,
|
||||
},
|
||||
alloc::{
|
||||
format,
|
||||
|
@ -24,10 +28,7 @@ use {
|
|||
facepalm::start_facepalm,
|
||||
lazy_static::lazy_static,
|
||||
log::*,
|
||||
shadeable::pixel_format::from_vga_16,
|
||||
vga::colors::Color16,
|
||||
};
|
||||
|
||||
lazy_static! {
|
||||
pub static ref TICK: AtomicU64 = AtomicU64::new(0);
|
||||
pub static ref BOOT_CONF: BootConfig = boot_conf::BootConfig::new();
|
||||
|
@ -36,45 +37,23 @@ lazy_static! {
|
|||
/// The main entry point of the kernel
|
||||
#[no_mangle]
|
||||
pub fn kernel_main() -> ! {
|
||||
// log::set_max_level(BOOT_CONF.log_level());
|
||||
init::init();
|
||||
log::set_max_level(BOOT_CONF.log_level());
|
||||
|
||||
{
|
||||
{
|
||||
let mut scheduler = SCHEDULER.lock();
|
||||
|
||||
use crate::scheduler::Priority::*;
|
||||
let mut process_1 = scheduler.new_process(High);
|
||||
process_1.capabilities.files = FileAccess::Some(vec![PathRep {
|
||||
location: FileLocations::Home,
|
||||
file_name: "test".to_string(),
|
||||
}]);
|
||||
scheduler.add_process(process_1);
|
||||
for ref_process in &scheduler.list {
|
||||
trace!("{:?}", ref_process);
|
||||
}
|
||||
drop(scheduler);
|
||||
}
|
||||
|
||||
use crate::proto_filetable::file::FileLocations;
|
||||
|
||||
{
|
||||
let mut sock_print_id = SimpleSock::new();
|
||||
sock_print_id.register_protocol("Screen Printer".to_string());
|
||||
sock_print_id.write(format!("🐑").into());
|
||||
|
||||
let mut mode = SCREEN_BUFFER.lock();
|
||||
|
||||
mode.force_redraw();
|
||||
for current in (*String::from_utf8_lossy(&sock_print_id.peek().unwrap())).chars() {
|
||||
mode.draw_char(0, 0, current, from_vga_16(Color16::Red));
|
||||
}
|
||||
mode.copy_to_buffer();
|
||||
}
|
||||
// info!("AbleOS {} {}", KERNEL_VERSION, RELEASE_TYPE);
|
||||
let result = logger::init();
|
||||
match result {
|
||||
Ok(_) => {}
|
||||
Err(err) => error!("{}", err),
|
||||
}
|
||||
log_version_data();
|
||||
|
||||
let mut vterm0 = Vterm::new();
|
||||
vterm0.set_cursor_position(60, 40);
|
||||
vterm0.characters[0][0].character = 'a';
|
||||
|
||||
//
|
||||
|
||||
start_facepalm();
|
||||
|
||||
sloop()
|
||||
}
|
||||
|
||||
|
@ -105,3 +84,10 @@ pub fn log_version_data() {
|
|||
master().unwrap().brand_string().unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
pub fn generate_process_pass() -> u128 {
|
||||
use rdrand::RdRand;
|
||||
let gen = RdRand::new().unwrap();
|
||||
let ret = (gen.try_next_u64().unwrap() as u128) << 64 | (gen.try_next_u64().unwrap() as u128);
|
||||
ret
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
naked_functions,
|
||||
slice_pattern
|
||||
)]
|
||||
#![feature(abi_efiapi)]
|
||||
|
||||
/// Contains architecture specific code for aarch64.
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
|
@ -21,10 +22,14 @@
|
|||
pub mod arch;
|
||||
|
||||
/// Contains architecture specific code for x86_64.
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
#[cfg(all(target_arch = "x86_64", not(target_os = "uefi")))]
|
||||
#[path = "arch/x86_64/mod.rs"]
|
||||
pub mod arch;
|
||||
|
||||
#[cfg(all(target_arch = "x86_64", target_os = "uefi"))]
|
||||
#[path = "arch/uefi_86/mod.rs"]
|
||||
pub mod arch;
|
||||
|
||||
/// Contains architecture specific code for riscv64.
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
#[path = "arch/riscv/mod.rs"]
|
||||
|
@ -32,6 +37,7 @@ pub mod arch;
|
|||
|
||||
#[macro_use]
|
||||
pub mod print;
|
||||
pub mod graphics_api;
|
||||
|
||||
#[macro_use]
|
||||
pub extern crate log;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use core::sync::atomic::Ordering;
|
||||
|
||||
use crate::kmain::TICK;
|
||||
use crate::serial_println;
|
||||
// use crate::serial_println;
|
||||
use lliw::{Fg, Reset};
|
||||
pub use log::{debug, info, trace, warn};
|
||||
use log::{Level, Metadata, Record};
|
||||
|
||||
use crate::arch::drivers::timer::TIMER_INTERRUPT_HERTZ;
|
||||
// use crate::arch::drivers::timer::TIMER_INTERRUPT_HERTZ;
|
||||
|
||||
struct SimpleLogger;
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl log::Log for SimpleLogger {
|
|||
let color;
|
||||
let time = TICK.load(Ordering::Relaxed) as f64;
|
||||
|
||||
let time_float = time / TIMER_INTERRUPT_HERTZ;
|
||||
// let time_float = time / TIMER_INTERRUPT_HERTZ;
|
||||
|
||||
match record.level() {
|
||||
log::Level::Error => color = (Fg::Red, "$RED$"),
|
||||
|
@ -29,7 +29,7 @@ impl log::Log for SimpleLogger {
|
|||
log::Level::Debug => color = (Fg::Blue, "$BLUE$"),
|
||||
log::Level::Trace => color = (Fg::Yellow, "$YELLOW$"),
|
||||
}
|
||||
|
||||
/*
|
||||
serial_println!(
|
||||
"[{}{}{}][{}{}{}] {}",
|
||||
color.0,
|
||||
|
@ -40,6 +40,7 @@ impl log::Log for SimpleLogger {
|
|||
Reset,
|
||||
record.args(),
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
/// Clear the log buffer
|
||||
|
|
|
@ -9,6 +9,8 @@ use {crate::arch::sloop, core::panic::PanicInfo};
|
|||
///
|
||||
/// # Safety
|
||||
/// This function is unsafe because it does not guarantee that the panic is handled.
|
||||
|
||||
// #[cfg(not(target_os = "uefi"))]
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
error!("{}", info);
|
||||
|
|
|
@ -16,8 +16,8 @@ impl core::fmt::Write for Stdout {
|
|||
}
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
fn write_str(&mut self, s: &str) -> Result<(), Error> {
|
||||
use crate::experiments::absi::colorify;
|
||||
colorify(s);
|
||||
// use crate::experiments::absi::colorify;
|
||||
// colorify(s);
|
||||
// kprint!("{}", s);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@ pub const RELEASE_TYPE: &str = "debug";
|
|||
pub const RELEASE_TYPE: &str = "release";
|
||||
|
||||
pub fn start_facepalm() {
|
||||
info!("facepalm 🤦 launched!");
|
||||
info!("facepalm 🤦 version: {}", VERSION);
|
||||
info!("facepalm 🤦 {} mode", RELEASE_TYPE);
|
||||
|
||||
// info!("facepalm 🤦 launched!");
|
||||
// info!("facepalm 🤦 version: {}", VERSION);
|
||||
// info!("facepalm 🤦 {} mode", RELEASE_TYPE);
|
||||
info!("Latin 1 (ISO-8859-1)");
|
||||
// Drop into a debug shell
|
||||
}
|
||||
|
|
1
qprofiler
Submodule
1
qprofiler
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 39f39068029fce6a94c7bd5cc960b07d9d1b2288
|
|
@ -4,46 +4,47 @@ use clap::Parser;
|
|||
#[clap(version = clap::crate_version!(), author = clap::crate_authors!("\n"))]
|
||||
/// Hello Remember this is a feature
|
||||
enum Command {
|
||||
Run {
|
||||
#[clap(long, short)]
|
||||
debug: bool,
|
||||
Run {
|
||||
#[clap(long, short)]
|
||||
debug: bool,
|
||||
|
||||
#[clap(long, short, arg_enum)]
|
||||
machine: Option<MachineType>,
|
||||
},
|
||||
#[clap(long, short, arg_enum)]
|
||||
machine: Option<MachineType>,
|
||||
},
|
||||
|
||||
Doc {
|
||||
#[clap(long, short, arg_enum)]
|
||||
machine: Option<MachineType>,
|
||||
},
|
||||
Doc {
|
||||
#[clap(long, short, arg_enum)]
|
||||
machine: Option<MachineType>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(clap::ArgEnum, Debug, Clone)]
|
||||
enum MachineType {
|
||||
X86,
|
||||
RISCV,
|
||||
ARM,
|
||||
X86,
|
||||
RISCV,
|
||||
ARM,
|
||||
Uefi86,
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let args = Command::parse();
|
||||
let args = Command::parse();
|
||||
|
||||
match args {
|
||||
Command::Run { debug, machine } => {
|
||||
let _dir = xshell::pushd("./ableos");
|
||||
match args {
|
||||
Command::Run { debug, machine } => {
|
||||
let _dir = xshell::pushd("./ableos");
|
||||
|
||||
let _debug_log: &[&str] = match debug {
|
||||
true => &["-D", "debug.log"],
|
||||
false => &[],
|
||||
};
|
||||
match machine.unwrap_or(MachineType::X86) {
|
||||
MachineType::X86 => {
|
||||
xshell::cmd!("cargo run --release").run()?;
|
||||
}
|
||||
MachineType::ARM => {
|
||||
xshell::cmd!("cargo build --release --target=json_targets/aarch64-ableos.json")
|
||||
.run()?;
|
||||
#[rustfmt::skip]
|
||||
let _debug_log: &[&str] = match debug {
|
||||
true => &["-D", "debug.log"],
|
||||
false => &[],
|
||||
};
|
||||
match machine.unwrap_or(MachineType::X86) {
|
||||
MachineType::X86 => {
|
||||
xshell::cmd!("cargo run --release").run()?;
|
||||
}
|
||||
MachineType::ARM => {
|
||||
xshell::cmd!("cargo build --release --target=json_targets/aarch64-ableos.json")
|
||||
.run()?;
|
||||
#[rustfmt::skip]
|
||||
xshell::cmd!(
|
||||
"qemu-system-aarch64
|
||||
-machine virt
|
||||
|
@ -53,10 +54,11 @@ fn main() -> anyhow::Result<()> {
|
|||
-device virtio-keyboard
|
||||
"
|
||||
).run()?;
|
||||
}
|
||||
MachineType::RISCV => {
|
||||
xshell::cmd!("cargo build --release --target=riscv64gc-unknown-none-elf").run()?;
|
||||
#[rustfmt::skip]
|
||||
}
|
||||
MachineType::RISCV => {
|
||||
xshell::cmd!("cargo build --release --target=riscv64gc-unknown-none-elf")
|
||||
.run()?;
|
||||
#[rustfmt::skip]
|
||||
xshell::cmd!(
|
||||
"qemu-system-riscv64
|
||||
-machine virt
|
||||
|
@ -66,26 +68,38 @@ fn main() -> anyhow::Result<()> {
|
|||
-bios src/arch/riscv/firmwear/opensbi-riscv64-generic-fw_jump.bin
|
||||
-kernel target/riscv64gc-unknown-none-elf/release/ableos"
|
||||
).run()?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MachineType::Uefi86 => {
|
||||
xshell::cmd!("cargo build --release --target=x86_64-unknown-uefi").run()?;
|
||||
|
||||
Command::Doc { machine } => {
|
||||
let _dir = xshell::pushd("./ableos");
|
||||
xshell::cmd!(
|
||||
"uefi-run -b src/arch/uefi_86/firmware/OVMF-pure-efi.fd target/x86_64-unknown-uefi/release/ableos.efi -- -machine q35 -smp 4"
|
||||
)
|
||||
.run()?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
match machine.unwrap_or(MachineType::X86) {
|
||||
MachineType::X86 => {
|
||||
xshell::cmd!("cargo doc --open").run()?;
|
||||
}
|
||||
MachineType::ARM => {
|
||||
xshell::cmd!("cargo doc --open --target=json_targets/aarch64-ableos.json").run()?;
|
||||
}
|
||||
MachineType::RISCV => {
|
||||
xshell::cmd!("cargo doc --open --target=riscv64gc-unknown-none-elf").run()?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Command::Doc { machine } => {
|
||||
let _dir = xshell::pushd("./ableos");
|
||||
|
||||
Ok(())
|
||||
match machine.unwrap_or(MachineType::X86) {
|
||||
MachineType::X86 => {
|
||||
xshell::cmd!("cargo doc --open").run()?;
|
||||
}
|
||||
MachineType::ARM => {
|
||||
xshell::cmd!("cargo doc --open --target=json_targets/aarch64-ableos.json")
|
||||
.run()?;
|
||||
}
|
||||
MachineType::RISCV => {
|
||||
xshell::cmd!("cargo doc --open --target=riscv64gc-unknown-none-elf").run()?;
|
||||
}
|
||||
MachineType::Uefi86 => {
|
||||
xshell::cmd!("cargo doc --open --target=x86_64-unknown-uefi").run()?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
0
root_fs/LAYOUT.md
Normal file
0
root_fs/LAYOUT.md
Normal file
6
root_fs/init_proc.toml
Normal file
6
root_fs/init_proc.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Run all processes here at boot
|
||||
# This is a sample process
|
||||
[helloworld] # This is the name of the process
|
||||
binary = "bin://hello" # This is the binary to run
|
||||
spawn_order = "1" # Spawn order of the processes (lower is earlier)
|
||||
arguments = ["--name", "Hello World"] # Arguments to pass to the binary
|
1
userland/aos_wasm_stress_test/target/.rustc_info.json
Normal file
1
userland/aos_wasm_stress_test/target/.rustc_info.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"rustc_fingerprint":18003274168711798016,"outputs":{"17579209074980676242":{"success":true,"status":"","code":0,"stdout":"___.wasm\nlib___.rlib\n___.wasm\nlib___.a\n","stderr":"{\"message\":\"dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`\",\"code\":null,\"level\":\"warning\",\"spans\":[],\"children\":[],\"rendered\":\"warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`\\n\\n\"}\n{\"message\":\"dropping unsupported crate type `proc-macro` for target `wasm32-unknown-unknown`\",\"code\":null,\"level\":\"warning\",\"spans\":[],\"children\":[],\"rendered\":\"warning: dropping unsupported crate type `proc-macro` for target `wasm32-unknown-unknown`\\n\\n\"}\n{\"message\":\"2 warnings emitted\",\"code\":null,\"level\":\"warning\",\"spans\":[],\"children\":[],\"rendered\":\"warning: 2 warnings emitted\\n\\n\"}\n"},"2797684049618456168":{"success":false,"status":"exit status: 1","code":1,"stdout":"","stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"},"17598535894874457435":{"success":true,"status":"","code":0,"stdout":"rustc 1.60.0-nightly (498eeb72f 2022-01-31)\nbinary: rustc\ncommit-hash: 498eeb72f590e518e19746b346be53713689e207\ncommit-date: 2022-01-31\nhost: x86_64-unknown-linux-gnu\nrelease: 1.60.0-nightly\nLLVM version: 13.0.0\n","stderr":""},"931469667778813386":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/able/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"5309432699494263626":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n","stderr":""},"6067017610845943405":{"success":true,"status":"","code":0,"stdout":"___.wasm\nlib___.rlib\n___.wasm\nlib___.a\n/home/able/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"wasm32\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"wasm\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"unknown\"\ntarget_pointer_width=\"32\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\n","stderr":"warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`\n\nwarning: dropping unsupported crate type `proc-macro` for target `wasm32-unknown-unknown`\n\nwarning: 2 warnings emitted\n\n"},"1932693776494054550":{"success":false,"status":"exit status: 1","code":1,"stdout":"","stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"}},"successes":{}}
|
3
userland/aos_wasm_stress_test/target/CACHEDIR.TAG
Normal file
3
userland/aos_wasm_stress_test/target/CACHEDIR.TAG
Normal file
|
@ -0,0 +1,3 @@
|
|||
Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by cargo.
|
||||
# For information about cache directory tags see https://bford.info/cachedir/
|
|
@ -0,0 +1 @@
|
|||
8b99008540ca194e
|
|
@ -0,0 +1 @@
|
|||
{"rustc":12144636395764155066,"features":"[\"compiler-builtins\", \"core\", \"default\", \"mem\", \"rustc-dep-of-std\"]","target":2709041430195671023,"profile":17504242664759948721,"path":2957610746799249899,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release/.fingerprint/compiler_builtins-265d0505a77f2123/dep-build-script-build-script-build"}}],"rustflags":[],"metadata":14701936454766889299,"config":2202906307356721367,"compile_kind":0}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/release/build/compiler_builtins-265d0505a77f2123/build_script_build-265d0505a77f2123: /home/able/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.66/build.rs
|
||||
|
||||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/release/build/compiler_builtins-265d0505a77f2123/build_script_build-265d0505a77f2123.d: /home/able/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.66/build.rs
|
||||
|
||||
/home/able/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.66/build.rs:
|
|
@ -0,0 +1,3 @@
|
|||
Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by cargo.
|
||||
# For information about cache directory tags see https://bford.info/cachedir/
|
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
|
@ -0,0 +1,6 @@
|
|||
{"message":"cannot find macro `info` in this scope","code":null,"level":"error","spans":[{"file_name":"src/main.rs","byte_start":151,"byte_end":155,"line_start":12,"line_end":12,"column_start":5,"column_end":9,"is_primary":true,"text":[{"text":" info!(b\"hello\");","highlight_start":5,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: cannot find macro `info` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:12:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m12\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m info!(b\"hello\");\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\n\n"}
|
||||
{"message":"cannot find function `add` in this scope","code":{"code":"E0425","explanation":"An unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n fn bar() {\n Self; // error: unresolved name `Self`\n }\n}\n\n// or:\n\nlet x = unknown_variable; // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"src/main.rs","byte_start":133,"byte_end":136,"line_start":10,"line_end":10,"column_start":24,"column_end":27,"is_primary":true,"text":[{"text":" let ret = unsafe { add(1, 2) };","highlight_start":24,"highlight_end":27}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0425]\u001b[0m\u001b[0m\u001b[1m: cannot find function `add` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:10:24\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m10\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let ret = unsafe { add(1, 2) };\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m\n\n"}
|
||||
{"message":"found duplicate lang item `panic_impl`","code":{"code":"E0152","explanation":"A lang item was redefined.\n\nErroneous code example:\n\n```compile_fail,E0152\n#![feature(lang_items)]\n\n#[lang = \"owned_box\"]\nstruct Foo<T>(T); // error: duplicate lang item found: `owned_box`\n```\n\nLang items are already implemented in the standard library. Unless you are\nwriting a free-standing application (e.g., a kernel), you do not need to provide\nthem yourself.\n\nYou can build a free-standing crate by adding `#![no_std]` to the crate\nattributes:\n\n```ignore (only-for-syntax-highlight)\n#![no_std]\n```\n\nSee also the [unstable book][1].\n\n[1]: https://doc.rust-lang.org/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib\n"},"level":"error","spans":[{"file_name":"src/main.rs","byte_start":233,"byte_end":265,"line_start":20,"line_end":20,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"fn panic(_info: &PanicInfo) -> ! {","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lang item is first defined in crate `std` (which `test` depends on)","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"first definition in `std` loaded from /home/able/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-2c0a0e43b8090224.rlib","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"second definition in the local crate (`aos_wasm_stress_test`)","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0152]\u001b[0m\u001b[0m\u001b[1m: found duplicate lang item `panic_impl`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:20:1\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m20\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0mfn panic(_info: &PanicInfo) -> ! {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: the lang item is first defined in crate `std` (which `test` depends on)\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: first definition in `std` loaded from /home/able/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-2c0a0e43b8090224.rlib\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: second definition in the local crate (`aos_wasm_stress_test`)\u001b[0m\n\n"}
|
||||
{"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to 3 previous errors\u001b[0m\n\n"}
|
||||
{"message":"Some errors have detailed explanations: E0152, E0425.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mSome errors have detailed explanations: E0152, E0425.\u001b[0m\n"}
|
||||
{"message":"For more information about an error, try `rustc --explain E0152`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mFor more information about an error, try `rustc --explain E0152`.\u001b[0m\n"}
|
|
@ -0,0 +1 @@
|
|||
{"rustc":12144636395764155066,"features":"[]","target":12450528787789777486,"profile":1021633075455700787,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"wasm32-unknown-unknown/debug/.fingerprint/aos_wasm_stress_test-61e1c08f945f2897/dep-test-bin-aos_wasm_stress_test"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":8104632896995515128}
|
|
@ -0,0 +1 @@
|
|||
c004ba979c18a0f3
|
|
@ -0,0 +1 @@
|
|||
{"rustc":12144636395764155066,"features":"[]","target":12450528787789777486,"profile":7309141686862299243,"path":1684066648322511884,"deps":[[16512045861018094591,"libwasm",false,4070631371700431413]],"local":[{"CheckDepInfo":{"dep_info":"wasm32-unknown-unknown/debug/.fingerprint/aos_wasm_stress_test-ccf7a9b3c2579b99/dep-bin-aos_wasm_stress_test"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":8104632896995515128}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
|
@ -0,0 +1 @@
|
|||
{"rustc":12144636395764155066,"features":"[]","target":12450528787789777486,"profile":7309141686862299243,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"wasm32-unknown-unknown/debug/.fingerprint/aos_wasm_stress_test-d507c534f009c86d/dep-bin-aos_wasm_stress_test"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":8104632896995515128}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
|
@ -0,0 +1,4 @@
|
|||
{"message":"cannot find macro `info` in this scope","code":null,"level":"error","spans":[{"file_name":"src/main.rs","byte_start":151,"byte_end":155,"line_start":12,"line_end":12,"column_start":5,"column_end":9,"is_primary":true,"text":[{"text":" info!(b\"hello\");","highlight_start":5,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: cannot find macro `info` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:12:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m12\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m info!(b\"hello\");\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\n\n"}
|
||||
{"message":"cannot find function `add` in this scope","code":{"code":"E0425","explanation":"An unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n fn bar() {\n Self; // error: unresolved name `Self`\n }\n}\n\n// or:\n\nlet x = unknown_variable; // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"src/main.rs","byte_start":133,"byte_end":136,"line_start":10,"line_end":10,"column_start":24,"column_end":27,"is_primary":true,"text":[{"text":" let ret = unsafe { add(1, 2) };","highlight_start":24,"highlight_end":27}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0425]\u001b[0m\u001b[0m\u001b[1m: cannot find function `add` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:10:24\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m10\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let ret = unsafe { add(1, 2) };\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m\n\n"}
|
||||
{"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to 2 previous errors\u001b[0m\n\n"}
|
||||
{"message":"For more information about this error, try `rustc --explain E0425`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mFor more information about this error, try `rustc --explain E0425`.\u001b[0m\n"}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
|
@ -0,0 +1 @@
|
|||
49f46b3632a6ad4f
|
|
@ -0,0 +1 @@
|
|||
{"rustc":12144636395764155066,"features":"[]","target":12450528787789777486,"profile":1021633075455700787,"path":1684066648322511884,"deps":[[16512045861018094591,"libwasm",false,4070631371700431413]],"local":[{"CheckDepInfo":{"dep_info":"wasm32-unknown-unknown/debug/.fingerprint/aos_wasm_stress_test-f504b55631bb4804/dep-test-bin-aos_wasm_stress_test"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":8104632896995515128}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
|
@ -0,0 +1 @@
|
|||
35eac359aac97d38
|
|
@ -0,0 +1 @@
|
|||
{"rustc":12144636395764155066,"features":"[]","target":6513979472087742090,"profile":3735503092003429423,"path":9687252742856789285,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"wasm32-unknown-unknown/debug/.fingerprint/libwasm-b21332fe5cdaae2f/dep-lib-libwasm"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":8104632896995515128}
|
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-2214295b2507695e.wasm: src/main.rs
|
||||
|
||||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-2214295b2507695e.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
|
@ -0,0 +1,6 @@
|
|||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-61e1c08f945f2897.rmeta: src/main.rs src/libwasm.rs
|
||||
|
||||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-61e1c08f945f2897.d: src/main.rs src/libwasm.rs
|
||||
|
||||
src/main.rs:
|
||||
src/libwasm.rs:
|
|
@ -0,0 +1,5 @@
|
|||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-ccf7a9b3c2579b99.rmeta: src/main.rs
|
||||
|
||||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-ccf7a9b3c2579b99.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
|
@ -0,0 +1,6 @@
|
|||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-d507c534f009c86d.rmeta: src/main.rs src/libwasm.rs
|
||||
|
||||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-d507c534f009c86d.d: src/main.rs src/libwasm.rs
|
||||
|
||||
src/main.rs:
|
||||
src/libwasm.rs:
|
|
@ -0,0 +1,5 @@
|
|||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-f504b55631bb4804.rmeta: src/main.rs
|
||||
|
||||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/aos_wasm_stress_test-f504b55631bb4804.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/libwasm-b21332fe5cdaae2f.rmeta: /home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/lib.rs /home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/logger/mod.rs /home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/syscalls.rs
|
||||
|
||||
/home/able/Projects/ableos/userland/aos_wasm_stress_test/target/wasm32-unknown-unknown/debug/deps/libwasm-b21332fe5cdaae2f.d: /home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/lib.rs /home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/logger/mod.rs /home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/syscalls.rs
|
||||
|
||||
/home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/lib.rs:
|
||||
/home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/logger/mod.rs:
|
||||
/home/able/.cargo/git/checkouts/libwasm-d0e6e34f082f8703/b79b27c/src/syscalls.rs:
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue