Cosmos/source2/Users/Kudzu/Notes.html
kudzu_cp faaffecc61
2010-08-23 02:57:27 +00:00

167 lines
No EOL
6.5 KiB
HTML

<html>
<body>
<h3>
To Do</h3>
<ul>
<li>int.parse plug<ul>
<li>plug article</li>
</ul>
</li>
<li>tohex plug based on string input of X8 etc</li>
<li>Express article</li>
<li>Guess Demo</li>
<li>Watches - at least locals first</li>
</ul>
<h3>
Matthijs - Next Release</h3>
<ul>
<li>Literal bug<ul>
<li>
<pre>UInt32 x = 0x000010E1;
x = x &amp; 0xFFFFFFFC;
Console.WriteLine(x.ToHex());
This produces 000000E1
If you change it to
x = x &amp; 0x0FFFFFFC;
it works. It seems our compiler is outputting wrong when the high bit is set. The outputted ASM when the high bit is set is wrong:
System_Void__BreakpointsKernel_BreakpointsOS_BeforeRun____DOT__00000008:
; [Cosmos.IL2CPU.X86.IL.Ldc_I4]
push dword 0xFC
; Stack contains 2 items: (4, 4) </pre>
</li>
</ul>
</li>
<li>Express isnt showing any templates</li>
</ul>
<h3>
Matthijs - Next Release + 1</h3>
<ul>
<li>(joint with Kudzu) - Move all critical plugs out of old asms and remove building
of old asms.<ul>
<li>And the plugs also from CustomImplementations in IL2CPU?</li>
</ul>
</li>
<li>Exceptions dont work. Try int.parse(&quot;asdf&quot;). It runs but when the exception is
hit we get garbage back instead. (ie exceptions through plug proxy dont work)</li>
<li>We are still stuck on install.bat.. I made a change in Cosmos.Hardware.. but it
didnt take effect until I ran install.bat..</li>
<li>IL2CPU.AlwaysCompile attribute and get rid of IDT.Dummy</li>
<li>int j = Array.IndexOf(Digits, s[i]);<ul>
<li>When Digits is a char array, we get a plug needed error.</li>
</ul>
</li>
<li>Plugs <ul>
<li>Source Plugs - Leave as they are</li>
<li>Assembly Plugs - Change to have attribute on the TARGET instead of the
implementation and only allow assembly.. this cuts out the &quot;proxy&quot; class and
makes it easier to find plug impls. See Rings.html for more info. The assembly
level plugs can even go in the same assembly, source file and if we can the same
class? That is currently these assembly plugs require 3 classes to implement.
its ugly and messy... we can get it down to 2 - 1 + assembly (X# only!). Current
way is such a mess we even comment them as plugged, but then have to go guessing
where the impl is... See example down below....</li>
<li>Convert all source plugs and disable old attributes...so for new ones use new
names</li>
</ul>
</li>
<ul>
<li>We need to dynamically
load the plugs etc so we can just rebuild and run and even trace them without
rerunnig the bat for each change</li>
</ul>
<li>2010 support<ul>
<li>http://blogs.msdn.com/b/jacdavis/archive/2010/04/05/vs-2010-version-of-debugenginesample-is-now-available.aspx</li>
<li>Trivalik worked on some already</li>
</ul>
</li>
<li>Ring attributes and enforcement<ul>
<li>Also allow restriction of assembly references</li>
<li>Only allow core to be /unsafe, no others</li>
</ul>
</li>
<li>Ask on forums: How to debug the vsdebug pkg?<ul>
<li>http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/6a9a307a-19fa-4c06-8728-303c1f4dd0bc/</li>
</ul>
</li>
</ul>
<h3>
Even later</h3>
<ul>
<li>localloc - int.parse needs plug for now because of this.</li>
<li>use INT3 for BP? Will save 3 bytes per call.. which is a lot...</li>
<li>Gradual X# upgrades (Kudzu)</li>
<li>Filesystem</li>
<li>Memory Manager<ul>
<li>http://www.osdever.net/tutorials/view/memory-management-1</li>
<li>http://www.osdever.net/tutorials/view/memory-management-2</li>
</ul>
</li>
<li>UDP</li>
<li>TCP</li>
<li>Cosmos.Debug.Common - much in here is not common and should be moved to
VSDebug.. Add&nbsp; Readme.html that NASM and VSDebug use whats left</li>
<li>foreach / interfaces</li>
</ul>
<h3>
Farther Down</h3>
<ul>
<li>USB</li>
</ul>
<h3>
Notes</h3>
<p>
&nbsp;
<h3>
Assembly Plug Example</h3>
<h4>
Old way</h4>
<p>
(3 classes, often 3 source files as well)</p>
<pre>public class CPUBus {
// Plugged
public static void Write8(UInt16 aPort, byte aData) { }
...
[Plug(Target = typeof(Cosmos.Kernel.CPUBus))]
class CPUBus {
[PlugMethod(Assembler = typeof(Assemblers.IOWrite8))]
public static void Write8(UInt16 aPort, byte aData) { }
...
public sealed class IOWrite8: AssemblerMethod {
public override void AssembleNew(object aAssembler, object aMethodInfo) {
//TODO: This is a lot of work to write to a single port. We need to have some kind of inline ASM option that can emit a single out instruction
new CPUx86.Move { DestinationReg = CPUx86.Registers.EDX, SourceReg = CPUx86.Registers.EBP, SourceDisplacement = 0xC, SourceIsIndirect = true };
new CPUx86.Move { DestinationReg = CPUx86.Registers.EAX, SourceReg = CPUx86.Registers.EBP, SourceDisplacement = 0x8, SourceIsIndirect = true };
new CPUx86.Out { DestinationReg = CPUx86.Registers.AL };
}
} </pre>
<h4>
New way</h4>
<p>
See how much neater and self contained this is? :)</p>
<p>
public class CPUBus {<br />
&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp; [AsmBody(Assembler = typeof(IOWrite8))]<br />
&nbsp;&nbsp;&nbsp; public static void Write8(UInt16 aPort, byte aData) { }<br />
&nbsp;&nbsp;&nbsp; // Nested class even... :) Keeps it all in one unit!<br />
&nbsp;&nbsp;&nbsp; public class IOWrite8 : CodeBlock {
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public override void Assemble() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EDX = EBP + 0x0C;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EAX = EBP + 0x08;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Port[DX] = AL;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }
<br />
<br />
} </p>
</body>
</html>