Giter Site home page Giter Site logo

Comments (14)

RUAN0007 avatar RUAN0007 commented on May 22, 2024 4

Hi, 我怀疑stridepass的定义搞反了吧。根据字面意义, stride表示每一步跨越的步数, pass表示表示该进程当前已经运行的“长度”。根据作者 Carl A. Waldspurger 的博士生答辩slide第15页, 可见stride = stride1/ticket以及在allocation时, choose client C with minimum passC.pass += C.stride. (我假设论文中ticket与这里的priority意义相同)

from rcore-tutorial-book-v3.

wangzeping722 avatar wangzeping722 commented on May 22, 2024 1

ch3-lab 的代码,跟当前版本的实验内容对不上。

from rcore-tutorial-book-v3.

typhigh avatar typhigh commented on May 22, 2024 1

ch3-lab 的代码,跟当前版本的实验内容对不上。

you can copy user test from this:
https://github.com/LearningOS/rCore-Tutorial-Test-2022S

from rcore-tutorial-book-v3.

HangX-Ma avatar HangX-Ma commented on May 22, 2024 1

你好,这里的实验代码不太能对上吧,在实验要求里

fn sys_task_info(id: usize, ts: *mut TaskInfo) -> isize

要求两个参数,id和ts,但是在测试代码中

assert_eq!(0, task_info(&info));

只使用了一个参数,请问是不是我哪里理解错了

以最新的这个rCore-Tutorial-Code-2023S 实验指导书为准吧,这个 Tutorial 的维护好像停了,最新版的接口是对应的上的。 另外如果你是自己跟着 tutorial 把 OS 搭起来的, 测例中的 write 仅有一次。

感谢443的帮助,在2023S的测试环境中是实现了 flush 的, 两个 \n 会调用两次 flush 所以 sys_write 被调用了两次。版本不统一体验很糟糕... 😢

除此之外需要保证仅有 ch3_taskinfo 在运行, 不然几个时间点会产生很大偏差。

fn sys_task_info(ti: *mut TaskInfo) -> isize
struct TaskInfo {
    status: TaskStatus,
    syscall_times: [u32; MAX_SYSCALL_NUM],
    time: usize
}

from rcore-tutorial-book-v3.

lightbulb128 avatar lightbulb128 commented on May 22, 2024

BinaryHeap 是 std::collections 里的,但是我们无法使用 std,这该如何是好?

from rcore-tutorial-book-v3.

lightbulb128 avatar lightbulb128 commented on May 22, 2024

作业要求实现 sys_gettime() 但提供的仓库里已经实现的是 sys_get_time()。 这两个的确是不同的函数还是只是笔误?另外测例里指出,gettime 有两个参数 ts: &TimeVal, tz: usize,其中的 TimeVal(sec, usec) 分别是指什么?

from rcore-tutorial-book-v3.

zhanghx0905 avatar zhanghx0905 commented on May 22, 2024

可以用alloc::collections::binary_heap::BinaryHeap, 不过似乎需要先实现heap allocator,可参考下一章第一节。
助教说按ts: &TimeVal, tz: usize做作业,这个接口的语义可以参考https://man7.org/linux/man-pages/man2/gettimeofday.2.html

from rcore-tutorial-book-v3.

lightbulb128 avatar lightbulb128 commented on May 22, 2024

那么可以不使用BinaryHeap而是直接用O(n)枚举方法完成作业么

from rcore-tutorial-book-v3.

lightbulb128 avatar lightbulb128 commented on May 22, 2024

如果按照 guide.md 里的语义,gettime返回值是 0 或 -1,而不是返回时间值本身,那么测例里面 get_time() < wait_for 岂不是没有意义了,应该全部改掉才对。

from rcore-tutorial-book-v3.

zhanghx0905 avatar zhanghx0905 commented on May 22, 2024

如果按照 guide.md 里的语义,gettime返回值是 0 或 -1,而不是返回时间值本身,那么测例里面 get_time() < wait_for 岂不是没有意义了,应该全部改掉才对。

测例里面user系统调用的实现和示例代码也是不同的

from rcore-tutorial-book-v3.

will7101 avatar will7101 commented on May 22, 2024

BinaryHeap 是 std::collections 里的,但是我们无法使用 std,这该如何是好?

可以用这个crate,提供了不用动态分配内存的一些数据结构

from rcore-tutorial-book-v3.

KveinAxel avatar KveinAxel commented on May 22, 2024

简答2的chapter5相关代码是不是指向错了,应该是scheduler(L119-L138)指向的是allocproc(L90-L98)

from rcore-tutorial-book-v3.

Egbert8527 avatar Egbert8527 commented on May 22, 2024

为什么会有 Panicked at src/syscall.rs:130, sys_exit never returns!
看输出结果是调用了sys_exited,但是还是出现这个panick

from rcore-tutorial-book-v3.

kidcats avatar kidcats commented on May 22, 2024

你好,这里的实验代码不太能对上吧,在实验要求里

fn sys_task_info(id: usize, ts: *mut TaskInfo) -> isize

要求两个参数,id和ts,但是在测试代码中

assert_eq!(0, task_info(&info));

只使用了一个参数,请问是不是我哪里理解错了

from rcore-tutorial-book-v3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.