mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
Should run now
This commit is contained in:
parent
500e887d46
commit
a7ddae1db8
4 changed files with 326 additions and 331 deletions
|
|
@ -225,10 +225,10 @@ namespace Cosmos.Hardware {
|
||||||
WriteSerialString("\"/>\r\n");
|
WriteSerialString("\"/>\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WriteSerialString(string aData) {
|
public static void WriteSerialString(string aData) {
|
||||||
for (int i = 0; i < aData.Length; i++) {
|
//for (int i = 0; i < aData.Length; i++) {
|
||||||
Serial.WriteSerial(0, (byte)aData[i]);
|
// Serial.WriteSerial(0, (byte)aData[i]);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -4,15 +4,10 @@ using System.Text;
|
||||||
|
|
||||||
namespace Cosmos.Kernel {
|
namespace Cosmos.Kernel {
|
||||||
public class Serial {
|
public class Serial {
|
||||||
public static void Write(byte aSerialIdx, string aData) {
|
//public static void Write(byte aSerialIdx, string aData) {
|
||||||
for (int i = 0; i < aData.Length; i++) {
|
// for (int i = 0; i < aData.Length; i++) {
|
||||||
Hardware.Serial.WriteSerial(aSerialIdx, (byte)aData[i]);
|
// Hardware.Serial.WriteSerial(aSerialIdx, (byte)aData[i]);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
public static void WriteLine(byte aSerialIndex, string aText) {
|
|
||||||
Write(aSerialIndex, aText);
|
|
||||||
Write(aSerialIndex, "\r\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -26,25 +26,25 @@ namespace Cosmos.Kernel.Staging.Stages {
|
||||||
Console.WriteLine("Ext2 Initialization failed!");
|
Console.WriteLine("Ext2 Initialization failed!");
|
||||||
}
|
}
|
||||||
Stream xFileStream = xExt2.OpenFile(new string[] { "readme.txt" });
|
Stream xFileStream = xExt2.OpenFile(new string[] { "readme.txt" });
|
||||||
if (xFileStream == null) {
|
//if (xFileStream == null) {
|
||||||
Console.WriteLine("Couldn't read file!");
|
// Console.WriteLine("Couldn't read file!");
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
Console.Write("File length = ");
|
//Console.Write("File length = ");
|
||||||
Hardware.Storage.ATAOld.WriteNumber((uint)xFileStream.Length, 32);
|
//Hardware.Storage.ATAOld.WriteNumber((uint)xFileStream.Length, 32);
|
||||||
Console.WriteLine(" bytes");
|
//Console.WriteLine(" bytes");
|
||||||
byte[] xBytes = new byte[(int)xFileStream.Length];
|
//byte[] xBytes = new byte[(int)xFileStream.Length];
|
||||||
int xBytesRead = xFileStream.Read(xBytes, 0, (int)xFileStream.Length);
|
//int xBytesRead = xFileStream.Read(xBytes, 0, (int)xFileStream.Length);
|
||||||
DebugUtil.SendNumber("MatthijsStage", "Bytes Read", (uint)xBytesRead, 32);
|
//DebugUtil.SendNumber("MatthijsStage", "Bytes Read", (uint)xBytesRead, 32);
|
||||||
DebugUtil.SendByteStream("CPU", "Readme.txt contents", xBytes);
|
//DebugUtil.SendByteStream("CPU", "Readme.txt contents", xBytes);
|
||||||
char[] xChars = new char[xBytes.Length - 1];
|
//char[] xChars = new char[xBytes.Length - 1];
|
||||||
for (int i = 0; i < xChars.Length; i++) {
|
//for (int i = 0; i < xChars.Length; i++) {
|
||||||
xChars[i] = (char)xBytes[i];
|
// xChars[i] = (char)xBytes[i];
|
||||||
}
|
//}
|
||||||
String s = new String(xChars);
|
//String s = new String(xChars);
|
||||||
Console.Write("Contents: '");
|
//Console.Write("Contents: '");
|
||||||
Console.Write(s);
|
//Console.Write(s);
|
||||||
Console.WriteLine("'");
|
//Console.WriteLine("'");
|
||||||
//Console.Write("Contents of root (");
|
//Console.Write("Contents of root (");
|
||||||
//string[] xItems = xExt2.GetDirectoryEntries(new string[0]);
|
//string[] xItems = xExt2.GetDirectoryEntries(new string[0]);
|
||||||
//Hardware.Storage.ATAOld.WriteNumber((uint)xItems.Length, 8);
|
//Hardware.Storage.ATAOld.WriteNumber((uint)xItems.Length, 8);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue