Wattana 0 Posted November 15, 2018 Share Posted November 15, 2018 Assuming I need to write init.lua first, what should I put in for it to do something useful? Quote Link to post Share on other sites
0 SpaceBeeGaming 3 Posted November 15, 2018 Share Posted November 15, 2018 https://ocdoc.cil.li/tutorial:custom_oses Here is some information regarding custom OS. Quote Link to post Share on other sites
0 Wattana 0 Posted November 15, 2018 Author Share Posted November 15, 2018 1 hour ago, SpaceBeeGaming said: https://ocdoc.cil.li/tutorial:custom_oses Here is some information regarding custom OS. I already took a look at it but I have to clues how to implement some useful functions like print() or to run another program from init.lua. I am completely clueless Quote Link to post Share on other sites
0 Molinko 43 Posted November 15, 2018 Share Posted November 15, 2018 The print function is typically a wrapper over 'io.stdout', i.e 'io.write'. I'd look into how OpenOS handles this. Although this can become rather complex pretty quickly. If you plan on having unix like io then you might want to design your 'pipes' first and lay a convenient print function over them as it is more useful as a higher level function. Think about how your programs will run in your OS and then how your io will tie into the program environment. I think it would be really helpful for you to disassemble this aspect of OpenOS to better understand how you may want to design this. Am I making any sense?? Quote Link to post Share on other sites
0 payonel 21 Posted November 15, 2018 Share Posted November 15, 2018 @Molinkois correct that these things become complex quickly, but I think it is a LOT of fun things like term.write, print, and io.write call io.stdout:write. (by default) io.stdout is the tty stream, and io.stdout:write is https://github.com/MightyPirates/OpenComputers/blob/master-MC1.7.10/src/main/resources/assets/opencomputers/loot/openos/lib/tty.lua#L76 Quote Link to post Share on other sites
Assuming I need to write init.lua first, what should I put in for it to do something useful?
Link to post
Share on other sites