fix rebooting by clearing our main
This commit is contained in:
parent
b83f50c57c
commit
3d8fc8819c
@ -117,7 +117,10 @@ module Virtual
|
||||
end
|
||||
|
||||
def boot
|
||||
return self if @booted
|
||||
if @booted
|
||||
self.space.get_main.clear_source
|
||||
return self
|
||||
end
|
||||
boot_parfait!
|
||||
@init = Block.new("init",nil)
|
||||
@init.add_code Virtual::VirtualMain.new( self.space.get_init )
|
||||
@ -154,4 +157,13 @@ module Virtual
|
||||
|
||||
end
|
||||
|
||||
Parfait::Method.class_eval do
|
||||
# for testing we need to reuse the main function (or do we?)
|
||||
# so remove the code that is there
|
||||
def clear_source
|
||||
self.source.send :initialize , self
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
require_relative "boot"
|
||||
|
@ -132,9 +132,9 @@ module Virtual
|
||||
# mov and add will be called on Machine and generate Instructions that are then added
|
||||
# to the current block
|
||||
# also symbols are supported and wrapped as register usages (for bare metal programming)
|
||||
def method_missing(meth, *arg_names, &block)
|
||||
add_code ::Arm::ArmMachine.send(meth , *arg_names)
|
||||
end
|
||||
# def method_missing(meth, *arg_names, &block)
|
||||
# add_code ::Arm::ArmMachine.send(meth , *arg_names)
|
||||
# end
|
||||
|
||||
def byte_length
|
||||
@blocks.inject(0) { |c , block| c += block.byte_length }
|
||||
@ -148,6 +148,7 @@ module Virtual
|
||||
at = at + block.byte_length
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user