hoist parfait boot out of the machine boot

This commit is contained in:
Torsten Ruger
2018-06-30 00:39:23 +03:00
parent 8d7a2fe4d6
commit 46d8f5002f
35 changed files with 62 additions and 33 deletions

View File

@ -23,7 +23,6 @@ module Risc
end
attr_reader :constants , :cpu_init
attr_reader :translated
attr_reader :platform
# Translate code to whatever cpu is specified.
@ -34,7 +33,6 @@ module Risc
def translate( platform )
platform = platform.to_s.capitalize
@platform = Platform.for(platform)
@translated = true
translate_methods( @platform.translator )
@cpu_init = risc_init.to_cpu(@platform.translator)
end
@ -85,7 +83,6 @@ module Risc
# As code length may change during assembly, this way at least the objects stay
# in place and we don't have to deal with changing loading code
def position_all
raise "Not translated " unless @translated
#need the initial jump at 0 and then functions
Position.new(cpu_init).set(0)
code_start = position_objects( @platform.padding )
@ -165,8 +162,6 @@ module Risc
def boot
initialize
Position.clear_positions
@translated = false
Parfait.boot!
Builtin.boot_functions
self
end

View File

@ -15,6 +15,7 @@ module RubyX
end
def self.ruby_to_binary(source , platform = :arm)
Parfait.boot!
machine = Risc.machine.boot
ruby_to_mom(source)
machine.translate(platform)