This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Awe2K's profile picture

Os.run doesn't execute

Started by Awe2K, 01 November 2015 - 02:50 PM
Awe2K #1
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):
  1. Lists file in computer root and finds multiboot (.mbt) scripts
  2. Executes every line of script in built-in interpreter
  3. 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
Creator #2
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.
Awe2K #3
Posted 01 November 2015 - 08:39 PM
Target is an argument for that function.
It's first parameter of command "multiboot <target>"
CoderPuppy #4
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



Waitdev_ #5
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
Awe2K #6
Posted 02 November 2015 - 05:19 AM
Wait_ tried both ways. Nothing does work.
Seems strange that this thing works for someone else..
KingofGamesYami #7
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.
Awe2K #8
Posted 02 November 2015 - 02:06 PM
I've already tried this on both new computer and emulator
Awe2K #9
Posted 02 November 2015 - 02:46 PM
Okay, seems it fixed.
Just rebooted my PC and everything worked.
Thanks. :)/>