mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-21 21:38:52 +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");
|
||||
}
|
||||
|
||||
private static void WriteSerialString(string aData) {
|
||||
for (int i = 0; i < aData.Length; i++) {
|
||||
Serial.WriteSerial(0, (byte)aData[i]);
|
||||
}
|
||||
public static void WriteSerialString(string aData) {
|
||||
//for (int i = 0; i < aData.Length; 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 {
|
||||
public class Serial {
|
||||
public static void Write(byte aSerialIdx, string aData) {
|
||||
for (int i = 0; i < aData.Length; i++) {
|
||||
Hardware.Serial.WriteSerial(aSerialIdx, (byte)aData[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteLine(byte aSerialIndex, string aText) {
|
||||
Write(aSerialIndex, aText);
|
||||
Write(aSerialIndex, "\r\n");
|
||||
}
|
||||
//public static void Write(byte aSerialIdx, string aData) {
|
||||
// for (int i = 0; i < aData.Length; i++) {
|
||||
// Hardware.Serial.WriteSerial(aSerialIdx, (byte)aData[i]);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
|
@ -26,25 +26,25 @@ namespace Cosmos.Kernel.Staging.Stages {
|
|||
Console.WriteLine("Ext2 Initialization failed!");
|
||||
}
|
||||
Stream xFileStream = xExt2.OpenFile(new string[] { "readme.txt" });
|
||||
if (xFileStream == null) {
|
||||
Console.WriteLine("Couldn't read file!");
|
||||
return;
|
||||
}
|
||||
Console.Write("File length = ");
|
||||
Hardware.Storage.ATAOld.WriteNumber((uint)xFileStream.Length, 32);
|
||||
Console.WriteLine(" bytes");
|
||||
byte[] xBytes = new byte[(int)xFileStream.Length];
|
||||
int xBytesRead = xFileStream.Read(xBytes, 0, (int)xFileStream.Length);
|
||||
DebugUtil.SendNumber("MatthijsStage", "Bytes Read", (uint)xBytesRead, 32);
|
||||
DebugUtil.SendByteStream("CPU", "Readme.txt contents", xBytes);
|
||||
char[] xChars = new char[xBytes.Length - 1];
|
||||
for (int i = 0; i < xChars.Length; i++) {
|
||||
xChars[i] = (char)xBytes[i];
|
||||
}
|
||||
String s = new String(xChars);
|
||||
Console.Write("Contents: '");
|
||||
Console.Write(s);
|
||||
Console.WriteLine("'");
|
||||
//if (xFileStream == null) {
|
||||
// Console.WriteLine("Couldn't read file!");
|
||||
// return;
|
||||
//}
|
||||
//Console.Write("File length = ");
|
||||
//Hardware.Storage.ATAOld.WriteNumber((uint)xFileStream.Length, 32);
|
||||
//Console.WriteLine(" bytes");
|
||||
//byte[] xBytes = new byte[(int)xFileStream.Length];
|
||||
//int xBytesRead = xFileStream.Read(xBytes, 0, (int)xFileStream.Length);
|
||||
//DebugUtil.SendNumber("MatthijsStage", "Bytes Read", (uint)xBytesRead, 32);
|
||||
//DebugUtil.SendByteStream("CPU", "Readme.txt contents", xBytes);
|
||||
//char[] xChars = new char[xBytes.Length - 1];
|
||||
//for (int i = 0; i < xChars.Length; i++) {
|
||||
// xChars[i] = (char)xBytes[i];
|
||||
//}
|
||||
//String s = new String(xChars);
|
||||
//Console.Write("Contents: '");
|
||||
//Console.Write(s);
|
||||
//Console.WriteLine("'");
|
||||
//Console.Write("Contents of root (");
|
||||
//string[] xItems = xExt2.GetDirectoryEntries(new string[0]);
|
||||
//Hardware.Storage.ATAOld.WriteNumber((uint)xItems.Length, 8);
|
||||
|
|
|
|||
Loading…
Reference in a new issue