amaneureka / AtomOS

A multitasking monolithic Kernel based x86 targeting Operating System written in C# from scratch aiming for high-level implementation of drivers in managed environment.
http://www.atomixos.com
BSD 3-Clause "New" or "Revised" License
1.26k stars 85 forks source link

Crash on GenerateNewHashID() #55

Closed FletcherJ1 closed 7 years ago

FletcherJ1 commented 7 years ago

The OS crashes with seg fault. After trying to copy the string that is generated by this function. The Kernel.asm shows the function isn't complete. I narrowed the issue down to .ToString() not seem to be working Mono 4.8.0.0 Code: System_String_Atomix_Kernel_H_Gui_Window_GenerateNewHashID__: push dword EBP mov dword EBP, ESP sub dword ESP, 0x8 ; [Ldsflda] : OpField [0x0000-0x0005] System.UInt32 TicksFromStart => 0 push dword static_Field__System_UInt32_Atomix_Kernel_H_Devices_Timer_TicksFromStart ; Unimplemented ILCode 'Constrained'

This would result in the length of the string being > 4GB hence seg fault. Fix for this was to change to Convert.ToString(Timer.TicksFromStart) Kernel.txt GenerateNewHashID is in Window.cs in Gui

I think this is related to issue #4 and #5

amaneureka commented 7 years ago

Perfect. Yeah this is known issue which didn't crossed my mind.

amaneureka commented 7 years ago

I am making a quick fix like replacing it Convert.ToInt and adding error count at the end of log.

will follow up this issue on #5

Thanks! closing