From 11dc2bbddd27d4cdef2495be4dd3f7d6cdb8b1ca Mon Sep 17 00:00:00 2001 From: able Date: Mon, 1 Aug 2022 04:06:04 -0500 Subject: [PATCH] not fixed but I can't handle this anymore --- .gdbinit | 4 ++++ .gitignore | 2 +- ableos/Cargo.toml | 6 +++--- ableos/src/kmain.rs | 6 +++--- ableos/src/logger.rs | 4 ++-- ableos/src/scratchpad.rs | 4 +++- repbuild/src/main.rs | 11 ++++++----- 7 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 .gdbinit diff --git a/.gdbinit b/.gdbinit new file mode 100644 index 00000000..855ad965 --- /dev/null +++ b/.gdbinit @@ -0,0 +1,4 @@ +set history save on +file target/x86_64-ableos/debug/ableos +target remote localhost:9000 +tui enable diff --git a/.gitignore b/.gitignore index 98fd7993..e1f9a9ec 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,5 @@ userland/*/target kernel/target userland/root_fs/mnt/* target/ - +.gdb_history !*/.gitkeep diff --git a/ableos/Cargo.toml b/ableos/Cargo.toml index 194afcc7..b646c9c7 100644 --- a/ableos/Cargo.toml +++ b/ableos/Cargo.toml @@ -9,7 +9,7 @@ panic = "abort" [package.metadata.bootimage] run-args = [ - "--nodefaults", + # "--nodefaults", "-cpu", "Broadwell-v3", "-m", @@ -33,8 +33,8 @@ run-args = [ "../img.ext2", - "-qmp", - "unix:../qmp-sock,server,nowait", + # "-qmp", + # "unix:../qmp-sock,server,nowait", ] diff --git a/ableos/src/kmain.rs b/ableos/src/kmain.rs index 274e6a61..83ee0982 100644 --- a/ableos/src/kmain.rs +++ b/ableos/src/kmain.rs @@ -76,16 +76,16 @@ pub fn kernel_main() -> ! { // } /* log_version_data(); + // */ x86_64::instructions::interrupts::without_interrupts(|| { let mut scheduler = SCHEDULER.lock(); // comment this out to resume normal use // scheduler.enqueue_spawn(traceloop); - // scheduler.enqueue_spawn(scratchpad); + scheduler.enqueue_spawn(scratchpad); }); - // */ - scratchpad(); + // scratchpad(); sloop() } diff --git a/ableos/src/logger.rs b/ableos/src/logger.rs index 20254c8c..9b96df3d 100644 --- a/ableos/src/logger.rs +++ b/ableos/src/logger.rs @@ -51,8 +51,8 @@ impl log::Log for SimpleLogger { }; let line = match record.line() { - Some(line_number) => line_number.to_string(), - None => "??".to_string(), + Some(line_number) => line_number, + None => 0, }; if KERNEL_CONF.logging.log_to_serial { diff --git a/ableos/src/scratchpad.rs b/ableos/src/scratchpad.rs index 899e9db1..1cfaa157 100644 --- a/ableos/src/scratchpad.rs +++ b/ableos/src/scratchpad.rs @@ -137,7 +137,9 @@ pub fn real_shell() { buf.push(chr); print!("{}", chr); } - None => (), + None => { + // trace!("{}", buf); + } } } } diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index e816ba38..f6d5f010 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -54,14 +54,15 @@ fn main() -> anyhow::Result<()> { } => { let _dir = xshell::pushd("./ableos"); - let debug_log: &[&str] = match debug { - true => &["-D", "debug.log"], - false => &[], - }; match machine.unwrap_or(MachineType::X86) { MachineType::X86 => { // export RUSTFLAGS=\"-Cforce-unwind-tables -Clink-arg=-Wl,eh_frame.ld\" && - xshell::cmd!("cargo run --release -- -D debug.log").run()?; + + match debug { + true => xshell::cmd!("cargo run -- -S -gdb tcp::9000").run()?, + false => xshell::cmd!("cargo run --release").run()?, + } + if profile { xshell::cmd!("python qprofiler.py --path=qmp-sock --filename=target/x86_64-ableos/release/ableos").run()?; }