You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to compile your kernel because I'm having some problems in my own code, trying to use both libcore and rlibc (the compilation of the latter fails to find the former, giving me errors). But, when I try to compile your code I get this:
vagrant@packer-parallels-iso:/vagrant/rust-kernel$ make
make -C deps all
make[1]: Entering directory `/vagrant/rust-kernel/deps'
rustc --target=../i686-unknown-elf.json -L. --crate-type=rlib -C opt-level=3 -Z no-landing-pads rust//src/libcore/lib.rs
rustc --target=../i686-unknown-elf.json -L. --crate-type=rlib -C opt-level=3 -Z no-landing-pads rust//src/liballoc/lib.rs
rustc --target=../i686-unknown-elf.json -L. --crate-type=rlib -C opt-level=3 -Z no-landing-pads rust//src/librustc_unicode/lib.rs
rustc --target=../i686-unknown-elf.json -L. --crate-type=rlib -C opt-level=3 -Z no-landing-pads rust//src/libcollections/lib.rs
rustc --target=../i686-unknown-elf.json -L. --crate-type=rlib -C opt-level=3 -Z no-landing-pads rlibc.rs
rustc --target=../i686-unknown-elf.json -L. --crate-type=rlib -C opt-level=3 -Z no-landing-pads alloc_shim.rs
make[1]: Leaving directory `/vagrant/rust-kernel/deps'
make -C kernel all
make[1]: Entering directory `/vagrant/rust-kernel/kernel'
gcc -m32 -c -o boot01_mbr.o boot01_mbr.S
gcc -m32 -c -o boot02_SMPstart.o boot02_SMPstart.S
gcc -m32 -c -o interrupt_handlers.o interrupt_handlers.S
gcc -m32 -c -o machine.o machine.S
gcc -m32 -c -o start.o start.S
gcc -m32 -c -o tables.o tables.S
ar cr libasmcode.a interrupt_handlers.o machine.o start.o tables.o
rustc --target=../i686-unknown-elf.json -L. -L../deps -g -C opt-level=3 -Z no-landing-pads lib.rs
user_mode.rs:22:9: 22:22 error: use of unstable library feature 'box_raw': may be renamed or moved out of Box scope (see issue #27768)
user_mode.rs:22 Box::from_raw(must_allocate(size_of::<PageTable>(), PAGE_SIZE) as *mut PageTable)
^~~~~~~~~~~~~
user_mode.rs:22:9: 22:22 help: add #![feature(box_raw)] to the crate attributes to enable
machine.rs:54:1: 58:2 warning: function is never used: `invlpg`, #[warn(dead_code)] on by default
machine.rs:54 pub fn invlpg(vaddr: u32) {
machine.rs:55 unsafe {
machine.rs:56 _invlpg(vaddr);
machine.rs:57 }
machine.rs:58 }
vga.rs:4:5: 4:19 warning: variant is never used: `Blue`, #[warn(dead_code)] on by default
vga.rs:4 Blue = 1,
^~~~~~~~~~~~~~
vga.rs:6:5: 6:19 warning: variant is never used: `Cyan`, #[warn(dead_code)] on by default
vga.rs:6 Cyan = 3,
^~~~~~~~~~~~~~
vga.rs:7:5: 7:19 warning: variant is never used: `Red`, #[warn(dead_code)] on by default
vga.rs:7 Red = 4,
^~~~~~~~~~~~~~
vga.rs:9:5: 9:19 warning: variant is never used: `Brown`, #[warn(dead_code)] on by default
vga.rs:9 Brown = 6,
^~~~~~~~~~~~~~
vga.rs:11:5: 11:19 warning: variant is never used: `DarkGray`, #[warn(dead_code)] on by default
vga.rs:11 DarkGray = 8,
^~~~~~~~~~~~~~
vga.rs:14:5: 14:20 warning: variant is never used: `LightCyan`, #[warn(dead_code)] on by default
vga.rs:14 LightCyan = 11,
^~~~~~~~~~~~~~~
vga.rs:16:5: 16:20 warning: variant is never used: `LightPink`, #[warn(dead_code)] on by default
vga.rs:16 LightPink = 13,
^~~~~~~~~~~~~~~
vga.rs:17:5: 17:20 warning: variant is never used: `Yellow`, #[warn(dead_code)] on by default
vga.rs:17 Yellow = 14,
^~~~~~~~~~~~~~~
mmu.rs:27:1: 29:2 warning: function is never used: `mme`, #[warn(dead_code)] on by default
mmu.rs:27 fn mme(v: u32, left_bit: u32, right_bit: u32) -> u32 {
mmu.rs:28 (v & mask(left_bit, right_bit)) >> right_bit
mmu.rs:29 }
mmu.rs:41:5: 43:6 warning: method is never used: `get_p`, #[warn(dead_code)] on by default
mmu.rs:41 fn get_p(&self) -> u32 {
mmu.rs:42 mme(self.f1, 15, 15)
mmu.rs:43 }
interrupts/apic.rs:79:1: 83:2 warning: function is never used: `mask_irq`, #[warn(dead_code)] on by default
interrupts/apic.rs:79 pub fn mask_irq(irq: u8) {
interrupts/apic.rs:80 let irq_reg = 0x10 + (2 * irq);
interrupts/apic.rs:81 let direction = read_ioapic_reg(irq_reg);
interrupts/apic.rs:82 write_ioapic_reg(irq_reg, direction | (1 << 16));
interrupts/apic.rs:83 }
interrupts/context.rs:64:5: 68:6 warning: method is never used: `user_paging`, #[warn(dead_code)] on by default
interrupts/context.rs:64 pub fn user_paging(&self) {
interrupts/context.rs:65 unsafe {
interrupts/context.rs:66 asm!("mov %eax, %cr3" :: "{eax}"(self.cr3));
interrupts/context.rs:67 }
interrupts/context.rs:68 }
paging.rs:44:1: 50:2 warning: function is never used: `forget`, #[warn(dead_code)] on by default
paging.rs:44 pub fn forget(addr: usize) {
paging.rs:45 let mut next_frame = NEXT_FRAME_MUTEX.lock();
paging.rs:46 let page_index = (addr >> 12) & 0x3ff;
paging.rs:47 let pt = page_table_for(addr as u32, &mut *next_frame);
paging.rs:48 pt[page_index] &= !1;
paging.rs:49 machine::invlpg(addr as u32)
...
malloc.rs:193:1: 195:2 warning: function is never used: `malloc`, #[warn(dead_code)] on by default
malloc.rs:193 pub unsafe fn malloc(size: usize) -> *mut u8 {
malloc.rs:194 rust_allocate(size, 1)
malloc.rs:195 }
malloc.rs:222:1: 224:2 warning: function is never used: `realloc`, #[warn(dead_code)] on by default
malloc.rs:222 pub unsafe fn realloc(ptr: *mut u8, size: usize) -> *mut u8 {
malloc.rs:223 rust_reallocate(ptr, 1, size, 1)
malloc.rs:224 }
error: aborting due to previous error
make[1]: *** [librustcode.a] Error 101
make[1]: Leaving directory `/vagrant/rust-kernel/kernel'
make: *** [kernel] Error 2
Hi,
Trying to compile your kernel because I'm having some problems in my own code, trying to use both
libcore
andrlibc
(the compilation of the latter fails to find the former, giving me errors). But, when I try to compile your code I get this:rustc version is this:
Any ideas/suggestions/etc? Thanks in advance.
The text was updated successfully, but these errors were encountered: