Skip to content
Browse files

WIP: Fixes for IDE

1 parent e9982dc commit 2d54c6dc4f2100679b23fd6d2e1a446333b53585 @jackpot51 jackpot51 committed
Showing with 17 additions and 16 deletions.
  1. +8 −8 Makefile
  2. +6 −6 kernel/disk/ide.rs
  3. +3 −2 kernel/syscall/file.rs
View
16 Makefile
@@ -528,22 +528,22 @@ virtualbox: $(BUILD)/harddrive.bin
echo "Set Configuration"
$(VBM) modifyvm Redox --memory 1024
$(VBM) modifyvm Redox --vram 16
- $(VBM) modifyvm Redox --nic1 nat
- $(VBM) modifyvm Redox --nictype1 82540EM
- $(VBM) modifyvm Redox --nictrace1 on
- $(VBM) modifyvm Redox --nictracefile1 $(BUILD)/network.pcap
+ # $(VBM) modifyvm Redox --nic1 nat
+ # $(VBM) modifyvm Redox --nictype1 82540EM
+ # $(VBM) modifyvm Redox --nictrace1 on
+ # $(VBM) modifyvm Redox --nictracefile1 $(BUILD)/network.pcap
$(VBM) modifyvm Redox --uart1 0x3F8 4
$(VBM) modifyvm Redox --uartmode1 file $(BUILD)/serial.log
- $(VBM) modifyvm Redox --usb on
+ $(VBM) modifyvm Redox --usb off # on
$(VBM) modifyvm Redox --keyboard ps2
$(VBM) modifyvm Redox --mouse ps2
- #$(VBM) modifyvm Redox --audio $(VB_AUDIO)
- #$(VBM) modifyvm Redox --audiocontroller ac97
+ # $(VBM) modifyvm Redox --audio $(VB_AUDIO)
+ # $(VBM) modifyvm Redox --audiocontroller ac97
echo "Create Disk"
$(VBM) convertfromraw $< $(BUILD)/harddrive.vdi
echo "Attach Disk"
#PATA
- #$(VBM) storagectl Redox --name ATA --add ide --controller PIIX4 --bootable on
+ # $(VBM) storagectl Redox --name ATA --add ide --controller PIIX4 --bootable on
#SATA
$(VBM) storagectl Redox --name ATA --add sata --controller IntelAHCI --bootable on --portcount 1
$(VBM) storageattach Redox --storagectl ATA --port 0 --device 0 --type hdd --medium $(BUILD)/harddrive.vdi
View
12 kernel/disk/ide.rs
@@ -295,11 +295,11 @@ impl IdeDisk {
for word in 10..20 {
let d = destination.read(word);
let a = ((d >> 8) as u8) as char;
- if a != ' ' {
+ if a != ' ' && a != '\0' {
debug!("{}", a);
}
let b = (d as u8) as char;
- if b != ' ' {
+ if b != ' ' && b != '\0' {
debug!("{}", b);
}
}
@@ -308,11 +308,11 @@ impl IdeDisk {
for word in 23..27 {
let d = destination.read(word);
let a = ((d >> 8) as u8) as char;
- if a != ' ' {
+ if a != ' ' && a != '\0' {
debug!("{}", a);
}
let b = (d as u8) as char;
- if b != ' ' {
+ if b != ' ' && b != '\0' {
debug!("{}", b);
}
}
@@ -321,11 +321,11 @@ impl IdeDisk {
for word in 27..47 {
let d = destination.read(word);
let a = ((d >> 8) as u8) as char;
- if a != ' ' {
+ if a != ' ' && a != '\0' {
debug!("{}", a);
}
let b = (d as u8) as char;
- if b != ' ' {
+ if b != ' ' && b != '\0' {
debug!("{}", b);
}
}
View
5 kernel/syscall/file.rs
@@ -118,10 +118,11 @@ pub fn do_sys_mkdir(path: *const u8, flags: usize) -> Result<usize> {
::env().mkdir(try!(Url::from_str(&path_string)), flags).and(Ok(0))
}
-pub fn do_sys_open(path: *const u8, flags: usize) -> Result<usize> {
+pub fn do_sys_open(path_c: *const u8, flags: usize) -> Result<usize> {
let contexts = ::env().contexts.lock();
let current = try!(contexts.current());
- let path = current.canonicalize(c_string_to_str(path));
+ let path = current.canonicalize(c_string_to_str(path_c));
+ //debugln!("{}: {}: open {}", current.pid, current.name, path);
let url = try!(Url::from_str(&path));
let resource = try!(::env().open(url, flags));
let fd = current.next_fd();

0 comments on commit 2d54c6d

Please sign in to comment.
Something went wrong with that request. Please try again.