Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "uname" command shows up incorrect results #26

Closed
wangyisong1996 opened this issue May 11, 2020 · 2 comments · Fixed by #125
Closed

The "uname" command shows up incorrect results #26

wangyisong1996 opened this issue May 11, 2020 · 2 comments · Fixed by #125
Labels
bug Something isn't working

Comments

@wangyisong1996
Copy link

  • Ubuntu 20.04 Desktop (64 bit)
  • rustup 1.21.1 (7832b2ebe 2019-12-20)
  • rustc 1.44.0-nightly (b543afca9 2020-04-05)
  • Followed README.md to build zCore
  • Run cargo run --release -p linux-loader /bin/busybox uname -a
  • Got the result
    rCore orz 0.1.0 1 machine Linux

Should zCore kernel have a uname starting with zCore?

@wangrunji0408 wangrunji0408 added the bug Something isn't working label May 11, 2020
@yunwei37
Copy link
Contributor

yunwei37 commented Aug 2, 2020

It seems the uname string is hard-coded:

in linux-syscall/src/misc.rs

pub fn sys_uname(&self, buf: UserOutPtr<u8>) -> SysResult {
        info!("uname: buf={:?}", buf);

        let strings = ["rCore", "orz", "0.1.0", "1", "machine", "domain"];
        for (i, &s) in strings.iter().enumerate() {
            const OFFSET: usize = 65;
            buf.add(i * OFFSET).write_cstring(s)?;
        }
        Ok(0)
    }

@wangrunji0408
Copy link
Member

The uname should start with Linux because some programs will check this field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants