Giter Club home page Giter Club logo

kernel's People

Contributors

0xax avatar alevy avatar ashleygwilliams avatar brendanbuono avatar dato avatar dirk avatar hawkw avatar nxnfufunezn avatar omern1 avatar phil-opp avatar rschulman avatar rylev avatar simonsapin avatar slayerjain avatar steveej avatar steveklabnik avatar wilsongiese avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kernel's Issues

License missing?

The Readme reads:

This project is dual licensed under Apache2/MIT. See the two LICENSE-* files for details.

But there is no such file in this repository. Maybe it was accidentally deleted? Would be good to re-add them.

Fix up make

In #9, I split up the makefile into a few steps, for Travis. But 'make' doesn't do the right thing, because I'm lazy and haven't made it do the right thing yet.

[Question] IRC/group to discuss about the project?

I'm trying to implement my own VGA driver myself.
I made a simple solution using a macro, like the example given at the end of the chapter kmain, but I have a LOT of questions to perform myself in Rust :-)

Is an IRC/channel/group exists to discuss about that?

Thanks a lot!

keyboard handler stops main?

If I change src/lib.rs like this:

    let mut i = 0;
    loop {
        kprintln!("i {}", i);
        i = i + 1;
    }

It prints just fine, but when i hit a key, it doesn't resume printing.

OS X

Hi all, I decided to take a crack at getting this sucker working on os x. I went through and documented my steps in a script. @steveklabnik said an issue would be good to document this stuff so yay ๐ŸŽ‰.

Things the script does:

  1. brew install tools that it can like gmp, mpfr, libmpc, autoconf, and automake
  2. Download and compile tools in order to make a cross compiler: binutils, gcc, objconv
  3. Download and compile grub using the cross compiler

This works or at least doesn't error out obviously. I'm going to run through this process again when I have more time to see if there are any silent errors.

By changing the Makefile a little to point at the ld and grub-mkrescue that you just made you should be able to run make now. Nothing errors, but at this point nothing shows up after you have the kernel running.

Also I'm a super newbie at all of this stuff so I apologize if something is wrong. Also just a disclaimer the script above downloads and compiles stuff into your home dir. I suggest you read it or edit it if you want to change the dirs that it puts stuff in. They should be made configurable at some point.

I'll post here with any follow up I find.

Figure out why nasm 2.12 hates a macro

The version of nasm packaged with debian stretch doesn't work, but the one with jessie does. It appears to be a change between nasm 2.11 and nasm 2.12, but working on both seems like a good idea.

Installation of specific rustc version fails

When running rustup install nightly-2016-05-26 on macOS 10.12 with all updates applied, the command never exists.

It prints:

adrianbrink@ab-mbp:~|โ‡’  rustup install nightly-2016-05-26
info: syncing channel updates for 'nightly-2016-05-26-x86_64-apple-darwin'
info: downloading component 'rustc'
 42.1 MiB /  42.1 MiB (100 %)   1.8 MiB/s ETA:   0 s
info: downloading component 'rust-std'
 55.1 MiB /  55.1 MiB (100 %) 768.0 KiB/s ETA:   0 s
info: downloading component 'rust-docs'
  6.5 MiB /   6.5 MiB (100 %)   1.0 MiB/s ETA:   0 s
info: downloading component 'cargo'
  2.7 MiB /   2.7 MiB (100 %)   1.2 MiB/s ETA:   0 s
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'rust-docs'
info: installing component 'cargo'

And just hangs there forever. The same problem exists for nightly-2016-05-27, which I guess means that it fails for this installation method.

Is there any quick fix for this, until rustup.rs fixes this.

I'm also going to raise an issue there.

Cleanup PIC crate

The PIC crate is kind of a hack. It'd be nice to fix it up.

  • Use x86 instead of inline asm for outb/inb
  • Is this list of functions right? What would a good interface for a PIC be?

On systems that boot from EFI by default, qemu cannot read the image

So I've spent a couple days struggling with this, but I finally found an answer that helped.

tl;dr If you're developing in an OS that has been booted on an EFI system, grub-mkrescue assumes you want your image to have the EFI protections as well. In that case, you'll see a message about failing to boot from CDROM, specifically code 0009. In that case, you need to install grub-pc-bin and update your Makefile so the grub-mkrescue line looks like:

    grub-mkrescue /usr/lib/grub/i386-pc -o build/os.iso build/isofiles

Cheers!

`cargo test` doesn't work

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/steve/src/intermezzOS/kernel/target/debug/deps/intermezzos-f72332709373820b.0.o" "-o" "/home/steve/src/intermezzOS/kernel/target/debug/deps/intermezzos-f72332709373820b" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/steve/src/intermezzOS/kernel/target/debug/deps" "-L" "/home/steve/src/intermezzOS/kernel/target/debug/build/intermezzos-ae49b6d4bcb27c57/out" "-L" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l" "boot" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "/home/steve/src/intermezzOS/kernel/target/debug/deps/libconsole.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-411f48d3.rlib" "/home/steve/src/intermezzOS/kernel/target/debug/deps/libspin-d054d2d05cd86dc1.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-411f48d3.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
  = note: /usr/bin/ld: /home/steve/src/intermezzOS/kernel/target/debug/build/intermezzos-ae49b6d4bcb27c57/out/libboot.a(boot.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/home/steve/src/intermezzOS/kernel/target/debug/build/intermezzos-ae49b6d4bcb27c57/out/libboot.a(boot.o): error adding symbols: Bad value


error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/steve/src/intermezzOS/kernel/target/debug/intermezzos-b45e4ac16f1d637d.0.o" "-o" "/home/steve/src/intermezzOS/kernel/target/debug/intermezzos-b45e4ac16f1d637d" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/steve/src/intermezzOS/kernel/target/debug/deps" "-L" "/home/steve/src/intermezzOS/kernel/target/debug/build/intermezzos-ae49b6d4bcb27c57/out" "-L" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/steve/src/intermezzOS/kernel/target/debug/deps/librlibc-975886925ea7e4d8.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm-411f48d3.rlib" "/home/steve/src/intermezzOS/kernel/target/debug/deps/libintermezzos.rlib" "/home/steve/src/intermezzOS/kernel/target/debug/deps/libconsole.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-411f48d3.rlib" "/home/steve/src/intermezzOS/kernel/target/debug/deps/libspin-d054d2d05cd86dc1.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-411f48d3.rlib" "/home/steve/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-411f48d3.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
  = note: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

We don't currently have any unit tests here, so it's not a problem, but we should figure this out and fix it.

Someone on IRC told me that the PIC stuff would be fixed if we used gcc to assemble rather than nasm. Unsure though.

License

What's the license for the code here?

missing instructions for setting up a cross linker for macOS

add these instructions to the README: http://intermezzos.github.io/book/appendix/osx-install.html

make cargo on macOS gives this error. this is because macOS has the wrong ld (BSD), we need the GNU ld.

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Tlayout.ld" "-Wl,-n" "-nostartfiles" "-L" "/Users/ag_dubs/.xargo/lib/rustlib/x86_64-unknown-intermezzos-gnu/lib" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/intermezzos.0.o" "-o" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/intermezzos" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/deps" "-L" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/build/intermezzos-491f39d1c9fb19a5/out" "-L" "/Users/ag_dubs/.xargo/lib/rustlib/x86_64-unknown-intermezzos-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l" "boot" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/deps/libkernel_context.rlib" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/deps/libvga.rlib" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/deps/librlibc-975886925ea7e4d8.rlib" "/Users/ag_dubs/intermezzOS/kernel/src/target/x86_64-unknown-intermezzos-gnu/release/deps/libspin-d054d2d05cd86dc1.rlib" "/Users/ag_dubs/.xargo/lib/rustlib/x86_64-unknown-intermezzos-gnu/lib/libcore.rlib"
  = note: ld: unknown option: -n
clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: Could not compile `intermezzos`.

To learn more, run the command again with --verbose.
error: `cargo` process didn't exit successfully
make: *** [cargo] Error 101

Virtual Machine for Development

Speaking with @steveklabnik we both came to the conclusion that only supporting a linux development environment is probably the best thing to do (at least to begin with). I've started trying to get the kernel running in a Linux Virtual Box VM using @ashleygwilliams Vagrantfile from a similar project (per @steveklabnik's suggestion). I've run into a few issues, which I'll hopefully have sorted out soon. I'll have a PR ready when I can find sometime through the holiday season obligations.

Implement paging

Identity paging has been completed, but that's not great. We should do actual paging. what kind is yet TBD.

Unit testing; what to do about protected components?

I was just messing around a bit, trying to add a cursor back into the new VGA code on my fork, no issues running the code in QEMU, but definitely had issues trying to access VGA hardware registers in test code. I basically broke all VGA tests by causing SIGSEGVs (woo!).

Wondering what the options are for unit testing code that needs to work so close to metal...

In school we wrote components for PintOS, but all the testing was done by running executables in user space. This worked quite well, but its really system testing, not unit testing. Without writing the kernel code to be accommodating of unit testing (lots of traits? Passing around real & mock impls), I'm not seeing how to assert on some aspects of the kernel directly.

QEMU Bootloop after completing 4.3

After completing Chapter 4.3 and running my code using make, QEMU starts flashing between:

SeaBIOS (version 1.7.4-20150827_223240-lgw01-56)


       iPXE (http://ipxe.org) 00:03.0 C900 PCI2.10 PnP PMM+07FC10F0+07F210F0 C900



       Booting from Hard Disk...
       Boot failed: could not read the boot disk

       Booting from Floppy...
       Boot failed: could not read the boot disk

       Booting from DVD/CD...

and
VGA Blank mode

What can I do to fix this?

A roadmap for the book?

Hey,

I am following this project with great interest. I wonder if there is any kind of schedule or a plan for the next chapters (because I want to start playing with osdev using this project when it gets to the printing to screen stuff and I want to schedule my other side projects now)

Implement VGA driver

Current status: this has been implemented, but not yet written about in the book.

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.