Merge #213 213: add comment on where to look to view 'Hello World' message r=jrvanwhy a=JOE1994 This PR adds a one helping comment to the example program **examples/hello_world.rs**. The comment tells where to look to see the "Hello World" message printed out. I thought adding this line would be helpful to newcomers like me :smile_cat: p.s. Is running `tockloader listen` the canonical way to view messages printed to the console? Thank you for reviewing this PR :) :cake: Co-authored-by: JOE1994 <joseph942010@gmail.com>
diff --git a/core/src/entry_point/mod.rs b/core/src/entry_point/mod.rs index 2ab2351..850c213 100644 --- a/core/src/entry_point/mod.rs +++ b/core/src/entry_point/mod.rs
@@ -104,10 +104,8 @@ ); // Zero .bss (specified by the linker script). - let bss_end = layout_header.bss_start + layout_header.bss_size; // 1 past the end of .bss - for i in layout_header.bss_start..bss_end { - core::ptr::write(i as *mut u8, 0); - } + let bss_start = layout_header.bss_start as *mut u8; + core::ptr::write_bytes(bss_start, 0u8, layout_header.bss_size); // TODO: Wait for rustc to have working ROPI-RWPI relocation support, then // implement dynamic relocations here. At the moment, rustc does not have
diff --git a/layout_generic.ld b/layout_generic.ld index 35b10f4..dd101ab 100644 --- a/layout_generic.ld +++ b/layout_generic.ld
@@ -88,6 +88,15 @@ /* Application stack */ .stack (NOLOAD) : { + /* elf2tab requires that the `_sram_origin` symbol be present to + * mark the first address in the SRAM memory. Since ELF files do + * not really need to specify this address as they only care about + * loading into flash, we need to manually mark this address for + * elf2tab. elf2tab will use it to add a fixed address header in the + * TBF header if needed. + */ + _sram_origin = .; + . = . + STACK_SIZE; _stack_top_unaligned = .;