Don't build the kernel image for cross compiler
This commit is contained in:
53
source.elna
53
source.elna
@@ -26,7 +26,6 @@ type
|
||||
var
|
||||
next_paddr*: Pointer;
|
||||
|
||||
proc write_i(value: Int); extern;
|
||||
proc write_c(value: Char); extern;
|
||||
proc write_s(value: String); extern;
|
||||
|
||||
@@ -86,6 +85,44 @@ proc write_x*(value: Word, padding: Word) -> Word;
|
||||
return print_x(value, padding, write_c)
|
||||
end;
|
||||
|
||||
(* Writes a Word and puts it into the sink. *)
|
||||
proc print_w*(value: Word, sink: proc(Char)) -> Word;
|
||||
var
|
||||
buffer: [10]Char;
|
||||
i: Word;
|
||||
result: Word;
|
||||
character_code: Word;
|
||||
begin
|
||||
i := 0u;
|
||||
|
||||
if value = 0u then
|
||||
i := 1u;
|
||||
buffer[i] := '0'
|
||||
end;
|
||||
while value <> 0u do
|
||||
i := i + 1u;
|
||||
character_code := value % 10u + cast('0': Word);
|
||||
buffer[i] := cast(character_code: Char);
|
||||
value := value / 10u
|
||||
end;
|
||||
result := i;
|
||||
while i > 0u do
|
||||
sink(buffer[i]);
|
||||
i := i - 1u
|
||||
end;
|
||||
return result
|
||||
end;
|
||||
|
||||
(* Writes an Int and puts it into the sink. *)
|
||||
proc print_i*(value: Int, sink: proc(Char)) -> Word;
|
||||
begin
|
||||
if value < 0 then
|
||||
sink('-');
|
||||
value := -value
|
||||
end;
|
||||
return print_w(cast(value: Word), sink)
|
||||
end;
|
||||
|
||||
(*
|
||||
Converts 4 bytes of the input in network byte order into an unsigned integer.
|
||||
*)
|
||||
@@ -113,7 +150,7 @@ begin
|
||||
write_c('\n');
|
||||
|
||||
write_s("Total size: ");
|
||||
write_i(cast(header^.totalsize: Int));
|
||||
print_w(header^.totalsize, write_c);
|
||||
write_c('\n');
|
||||
|
||||
write_s("Struct offset: 0x");
|
||||
@@ -129,23 +166,23 @@ begin
|
||||
write_c('\n');
|
||||
|
||||
write_s("Version: ");
|
||||
write_i(cast(header^.version: Int));
|
||||
print_w(header^.version, write_c);
|
||||
write_c('\n');
|
||||
|
||||
write_s("Last compatible version: ");
|
||||
write_i(cast(header^.last_comp_version: Int));
|
||||
print_w(header^.last_comp_version, write_c);
|
||||
write_c('\n');
|
||||
|
||||
write_s("CPU id: ");
|
||||
write_i(cast(header^.boot_cpuid_phys: Int));
|
||||
print_w(header^.boot_cpuid_phys, write_c);
|
||||
write_c('\n');
|
||||
|
||||
write_s("Strings length: ");
|
||||
write_i(cast(header^.size_dt_strings: Int));
|
||||
print_w(header^.size_dt_strings, write_c);
|
||||
write_c('\n');
|
||||
|
||||
write_s("Struct length: ");
|
||||
write_i(cast(header^.size_dt_struct: Int));
|
||||
print_w(header^.size_dt_struct, write_c);
|
||||
write_c('\n')
|
||||
end;
|
||||
|
||||
@@ -198,7 +235,7 @@ begin
|
||||
else
|
||||
write_c(' ');
|
||||
stream := stream + property.len;
|
||||
write_i(cast(property.len: Int))
|
||||
print_w(property.len, write_c)
|
||||
end;
|
||||
write_c('\n');
|
||||
|
||||
|
Reference in New Issue
Block a user