38 posts
Location
Somewhere near keyboard
Posted 01 November 2015 - 03:50 PM
So, Hello. I'm first time on this forum. I've started to write my simple "multiboot"-compatible bootloader for computers.
The problem is that os.run and shell.run don't work for me. Os.run returns true, but doesn't actually execute my file.
How my loader works (tried to make it look something like GNU GRUB):
- Lists file in computer root and finds multiboot (.mbt) scripts
- Executes every line of script in built-in interpreter
- Commands are "multiboot <kernel>" (to boot file), "chainload" (now can only load CraftOS), "poweroff" (you know what it does)
So, I've created test script "script.mbt", and it contains only one line: "multiboot kernel.bin"
Kernel.bin just contains while loop that just sleeps (must hang execution for a time). But nothing happens and it just returns to shell.
<At function multiboot_(target)>:
http://pastebin.com/c1LSe061
2679 posts
Location
You will never find me, muhahahahahaha
Posted 01 November 2015 - 08:00 PM
I am not sure where you define target, but it should be a valid path, which means, a string.
38 posts
Location
Somewhere near keyboard
Posted 01 November 2015 - 08:39 PM
Target is an argument for that function.
It's first parameter of command "multiboot <target>"
130 posts
Posted 01 November 2015 - 11:23 PM
I tried it and it seems to work.
script.mbt
multiboot kernel.bin
kernel.bin
print("hi")
while true do
sleep(100)
end
818 posts
Location
Wherever you want me to be
Posted 01 November 2015 - 11:47 PM
not sure what you mean by it, but judging by the title you can do
shell.run("program arg1 arg2")
instead of os.run
38 posts
Location
Somewhere near keyboard
Posted 02 November 2015 - 05:19 AM
Wait_ tried both ways. Nothing does work.
Seems strange that this thing works for someone else..
3057 posts
Location
United States of America
Posted 02 November 2015 - 01:13 PM
Are you using an OS or any script that may modify something on the computer? Try placing a completely new computer and putting the code on it.
38 posts
Location
Somewhere near keyboard
Posted 02 November 2015 - 02:06 PM
I've already tried this on both new computer and emulator
38 posts
Location
Somewhere near keyboard
Posted 02 November 2015 - 02:46 PM
Okay, seems it fixed.
Just rebooted my PC and everything worked.
Thanks. :)/>