Merge pull request #92 from justxuewei/fix/kstack-leak

This commit is contained in:
Yifan Wu 2023-02-08 11:08:51 +08:00 committed by GitHub
commit 3924a5f756
8 changed files with 8 additions and 7 deletions

View file

@ -50,7 +50,7 @@ Here we manually compile and install Qemu 7.0.0. For example, on Ubuntu 18.04:
# install dependency packages # install dependency packages
$ sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \ $ sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
gawk build-essential bison flex texinfo gperf libtool patchutils bc \ gawk build-essential bison flex texinfo gperf libtool patchutils bc \
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3 python3-pip zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3 python3-pip ninja-build
# download Qemu source code # download Qemu source code
$ wget https://download.qemu.org/qemu-7.0.0.tar.xz $ wget https://download.qemu.org/qemu-7.0.0.tar.xz
# extract to qemu-7.0.0/ # extract to qemu-7.0.0/
@ -64,9 +64,7 @@ $ make -j$(nproc)
Then, add following contents to `~/.bashrc`(please adjust these paths according to your environment): Then, add following contents to `~/.bashrc`(please adjust these paths according to your environment):
``` ```
export PATH=$PATH:/home/shinbokuow/Downloads/built/qemu-7.0.0 export PATH=$PATH:/path/to/qemu-7.0.0/build
export PATH=$PATH:/home/shinbokuow/Downloads/built/qemu-7.0.0/riscv64-softmmu
export PATH=$PATH:/home/shinbokuow/Downloads/built/qemu-7.0.0/riscv64-linux-user
``` ```
Finally, update the current shell: Finally, update the current shell:

BIN
figures/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -5,6 +5,7 @@ use crate::task::schedule;
use crate::DEV_NON_BLOCKING_ACCESS; use crate::DEV_NON_BLOCKING_ACCESS;
use alloc::collections::BTreeMap; use alloc::collections::BTreeMap;
use virtio_drivers::{BlkResp, RespStatus, VirtIOBlk, VirtIOHeader}; use virtio_drivers::{BlkResp, RespStatus, VirtIOBlk, VirtIOHeader};
use crate::drivers::bus::virtio::VirtioHal;
#[allow(unused)] #[allow(unused)]
const VIRTIO0: usize = 0x10008000; const VIRTIO0: usize = 0x10008000;

View file

@ -5,6 +5,7 @@ use core::any::Any;
use embedded_graphics::pixelcolor::Rgb888; use embedded_graphics::pixelcolor::Rgb888;
use tinybmp::Bmp; use tinybmp::Bmp;
use virtio_drivers::{VirtIOGpu, VirtIOHeader}; use virtio_drivers::{VirtIOGpu, VirtIOHeader};
use crate::drivers::bus::virtio::VirtioHal;
const VIRTIO7: usize = 0x10007000; const VIRTIO7: usize = 0x10007000;
pub trait GpuDevice: Send + Sync + Any { pub trait GpuDevice: Send + Sync + Any {
fn update_cursor(&self); fn update_cursor(&self);

View file

@ -87,6 +87,7 @@ impl Drop for KernelStack {
KERNEL_SPACE KERNEL_SPACE
.exclusive_access() .exclusive_access()
.remove_area_with_start_vpn(kernel_stack_bottom_va.into()); .remove_area_with_start_vpn(kernel_stack_bottom_va.into());
KSTACK_ALLOCATOR.exclusive_access().dealloc(self.0);
} }
} }