mosa / MOSA-Project

Managed Operating System Alliance Project
https://www.mosa-project.org/
Other
409 stars 81 forks source link

Adding DeviceService to ServiceManager causes a `System.IndexOutOfRangeException` #1105

Closed jvyden closed 1 year ago

jvyden commented 1 year ago

image

I tried to debug this myself, but I'm not sure what is causing this. I was able to narrow it down to the last line of this snippet:

_serviceManager = new ServiceManager();
_deviceService = new DeviceService();

_serviceManager.AddService(_deviceService);

This is located here, and is called from here.

I am using a fork of MOSA, but this shouldn't count as the changed code doesn't affect anything in this codepath.

AnErrupTion commented 1 year ago

You need to add DeviceService to the ServiceManager at least after this line:

            Mosa.DeviceSystem.Setup.Initialize(_hal, _deviceService.ProcessInterrupt);
jvyden commented 1 year ago

Yep, that was it. Thank you!