-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call various kernel inits directly, rather than via an import #99
base: main
Are you sure you want to change the base?
Conversation
See: icexin#98 Because of the way go loads init functions from packages, any steps which must occur before kernel init (setting loglevels, perhaps) requires a bit of hacking. By generating these calls as a first class init function for a given unikernel we can avoid having to hack around the golang init function loader. This change adds a generate command to egg, which can be to allow developers to maintain their own eggos include file to allow for developers to change how their unikernel is run, such as being able to change the value of GOMAXPROCS, or disable networking. The build command now checks for the presence of this file. If it does not exist then the build command will use the current method of generating a file and overlay. Otherwise it uses the user specified file. Finally, the file we generate is prefixed with `zz_` to try and influence when the file loads, in order to let user specified init functions (like setting log levels) to run first
Hrm, not sure how to interpret that test failure- I actually can't even get Any pointers @icexin ? |
It seems that a driver is initialized twice, causing the io address to be remapped. This may be the reason. I'm not too sure. You can debug in this direction. |
Nice one, thanks! |
Ah, yeah- I see now. Because the repo contains I need to think about this more. I could remove |
Thanks @jspc, I will find time to review the code |
Cheers @icexin - no rush, enjoy your weekend! |
Hi, @jspc: This PR addresses the ability to manually configure driver modules. The solution is to generate a go file to decide which modules to load and in what order. Here are some of my thoughts on this PR:
In the long run, a module manager may be needed to provide module initialization, dependency management and configuration management. But it is out of scope of this PR. Any thought? |
BTW, |
As there are still some design considerations (e.g. #99 (comment)), I'd prefer to keep discussing various options before merging this PR (or a new PR with an alternative approach). We can consider what potential solutions there may be for using/initializing only parts of eggos, and try to evaluate pros/cons for those different approaches. Perhaps for this discussion, it's better to open an issue where we can keep such discussions concentrated. For instance, it may be possible to envision using |
The two original methods of using eggos in a unikernel work exactly the same as before. Everything is completely 100% backwars compatible.
The major change this PR introduces is to make that generated file contain various The reason it does this is to allow things like loglevels to be set as early as possible without having to hack around the module loader. If the additional Being able to adjust what boots (I, for instance, don't need to configure mice and keyboard support, and I'm building for a machine with more than 8 cores) was useful for me, and will unstick us later when we have more driver support, but if it's premature then that's cool too. @icexin - good point re: the templated string. I pretty much followed what was there before. I started writing a tool to generate that file based on inputs, but before I knew it I was nearly writing |
See: #98
Because of the way go loads init functions from packages, any steps which must occur before kernel init (setting loglevels, perhaps) requires a bit of hacking.
By generating these calls as a first class init function for a given unikernel we can avoid having to hack around the golang init function loader.
This change adds a generate command to egg, which can be to allow developers to maintain their own eggos include file to allow for developers to change how their unikernel is run, such as being able to change the value of GOMAXPROCS, or disable networking.
The build command now checks for the presence of this file. If it does not exist then the build command will use the current method of generating a file and overlay. Otherwise it uses the user specified file.
Finally, the file we generate is prefixed with
zz_
to try and influence when the file loads, in order to let user specified init functions (like setting log levels) to run first