Commit 81c4b8c9 authored by Jeremy Soller's avatar Jeremy Soller Committed by GitHub

Smp (#23)

* Fire up multiple processors

* Use IPIs to wake up secondary processors

* Much better exception information

* Modifications to show more information on fault

* WIP: Use real libstd

* Add TLS (not complete)

* Add random function, export getpid, cleanup

* Do not spin APs until new context

* Update rust

* Update rust

* Use rd/wrfsbase

* Implement TLS

* Implement compiler builtins and update rust

* Update rust

* Back to Redox libstd

* Update rust
parent e71e27a3
...@@ -30,11 +30,6 @@ fn main() { ...@@ -30,11 +30,6 @@ fn main() {
print!("{}", format!(" + AHCI on: {:X} IRQ: {}\n", bar, irq)); print!("{}", format!(" + AHCI on: {:X} IRQ: {}\n", bar, irq));
thread::spawn(move || { thread::spawn(move || {
unsafe {
syscall::iopl(3).expect("ahcid: failed to get I/O permission");
asm!("cli" :::: "intel", "volatile");
}
let address = unsafe { syscall::physmap(bar, 4096, MAP_WRITE).expect("ahcid: failed to map address") }; let address = unsafe { syscall::physmap(bar, 4096, MAP_WRITE).expect("ahcid: failed to map address") };
{ {
let socket_fd = syscall::open(":disk", syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK).expect("ahcid: failed to create disk scheme"); let socket_fd = syscall::open(":disk", syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK).expect("ahcid: failed to create disk scheme");
...@@ -56,7 +51,7 @@ fn main() { ...@@ -56,7 +51,7 @@ fn main() {
let mut packet = Packet::default(); let mut packet = Packet::default();
if socket.read(&mut packet).expect("ahcid: failed to read disk scheme") == 0 { if socket.read(&mut packet).expect("ahcid: failed to read disk scheme") == 0 {
break; break;
} }
scheme.handle(&mut packet); scheme.handle(&mut packet);
socket.write(&mut packet).expect("ahcid: failed to write disk scheme"); socket.write(&mut packet).expect("ahcid: failed to write disk scheme");
} }
......
...@@ -30,11 +30,6 @@ fn main() { ...@@ -30,11 +30,6 @@ fn main() {
print!("{}", format!(" + E1000 on: {:X}, IRQ: {}\n", bar, irq)); print!("{}", format!(" + E1000 on: {:X}, IRQ: {}\n", bar, irq));
thread::spawn(move || { thread::spawn(move || {
unsafe {
syscall::iopl(3).expect("e1000d: failed to get I/O permission");
asm!("cli" :::: "intel", "volatile");
}
let socket_fd = syscall::open(":network", syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK).expect("e1000d: failed to create network scheme"); let socket_fd = syscall::open(":network", syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK).expect("e1000d: failed to create network scheme");
let socket = Arc::new(RefCell::new(unsafe { File::from_raw_fd(socket_fd) })); let socket = Arc::new(RefCell::new(unsafe { File::from_raw_fd(socket_fd) }));
......
...@@ -122,7 +122,7 @@ fn main() { ...@@ -122,7 +122,7 @@ fn main() {
thread::spawn(|| { thread::spawn(|| {
unsafe { unsafe {
iopl(3).expect("ps2d: failed to get I/O permission"); iopl(3).expect("ps2d: failed to get I/O permission");
asm!("cli" :::: "intel", "volatile"); asm!("cli" : : : : "intel", "volatile");
} }
let input = File::open("display:input").expect("ps2d: failed to open display:input"); let input = File::open("display:input").expect("ps2d: failed to open display:input");
......
...@@ -31,11 +31,6 @@ fn main() { ...@@ -31,11 +31,6 @@ fn main() {
print!("{}", format!(" + RTL8168 on: {:X}, IRQ: {}\n", bar, irq)); print!("{}", format!(" + RTL8168 on: {:X}, IRQ: {}\n", bar, irq));
thread::spawn(move || { thread::spawn(move || {
unsafe {
syscall::iopl(3).expect("rtl8168d: failed to get I/O permission");
asm!("cli" :::: "intel", "volatile");
}
let socket_fd = syscall::open(":network", syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK).expect("rtl8168d: failed to create network scheme"); let socket_fd = syscall::open(":network", syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK).expect("rtl8168d: failed to create network scheme");
let socket = Arc::new(RefCell::new(unsafe { File::from_raw_fd(socket_fd) })); let socket = Arc::new(RefCell::new(unsafe { File::from_raw_fd(socket_fd) }));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment