Skip to content

Memory layout fixes#76

Merged
mato merged 3 commits intoSolo5:masterfrom
mato:memory-layout-fixes
Aug 18, 2016
Merged

Memory layout fixes#76
mato merged 3 commits intoSolo5:masterfrom
mato:memory-layout-fixes

Conversation

@mato
Copy link
Copy Markdown
Member

@mato mato commented Aug 18, 2016

Summary of changes:

mato added 3 commits August 18, 2016 13:47
- Ensure all input sections are placed in the correct output section.
  This addresses Solo5#73 by placing .data.*, .got and .got.plt in the .data
  output section.
- Unify symbols used as section delimiters to _stext, _etext, _erodata,
  _edata, _ebss and _end.
- Rename ukvm kernel_main() to _start(). The ukvm and virtio linker
  scripts are now identical with the exception of .bootstrap for virtio.
This was previously placed in .bootstrap. While this causes no harm,
technically bootstrap is placed in a read-only segment and the stack is
used read-write.
Cosmetic change to place _start at the beginning of the .text section.
@mato
Copy link
Copy Markdown
Member Author

mato commented Aug 18, 2016

/cc @djwillia @pqwy @sgrove

@mato
Copy link
Copy Markdown
Member Author

mato commented Aug 18, 2016

@hannesm Could you test this on FreeBSD to check it's not broken there?

@mato
Copy link
Copy Markdown
Member Author

mato commented Aug 18, 2016

I've tested this change against @pqwy's abstract-type test case and everything works.

-t virtio:

            |      ___|
  __|  _ \  |  _ \ __ \
\__ \ (   | | (   |  ) |
____/\___/ _|\___/____/
multiboot: Using memory: 0x100000 - 0x7fe0000
Initializing the KVM Paravirtualized clock.
Solo5: new bindings
STUB: getenv() called
+ ops: ops: 3161824, id: 2484551, compare: 2265792, hash: 2265824
+ ops: ops: 3161760, id: 2484548, compare: 2265904, hash: 2265840
+ ops: ops: 3162528, id: 2482125, compare: 1814624, hash: 1815056
+ ops: ops: 3162464, id: 2482013, compare: 1813552, hash: 1813568
ptr: 2482007

solo5_app_main() returned with 0
Kernel done.
Goodbye!

-t ukvm:

Setting the CPUID.
            |      ___|
  __|  _ \  |  _ \ __ \
\__ \ (   | | (   |  ) |
____/\___/ _|\___/____/
mem_size=20000000, kernel_end=30d000
Initializing the KVM Paravirtualized clock.
Solo5: new bindings
STUB: getenv() called
+ ops: ops: 3128928, id: 2459111, compare: 2239232, hash: 2239264
+ ops: ops: 3128864, id: 2459108, compare: 2239344, hash: 2239280
+ ops: ops: 3129632, id: 2456685, compare: 1788080, hash: 1788512
+ ops: ops: 3129568, id: 2456573, compare: 1787008, hash: 1787024
ptr: 2456567

solo5_app_main() returned with 0
Kernel done.
Goodbye!
KVM_EXIT_HLT

Also, static_website_tls (see #74) now works for me for both ukvm and virtio.

@djwillia
Copy link
Copy Markdown
Member

looks good to me. again, great job tracking this down

@hannesm
Copy link
Copy Markdown
Contributor

hannesm commented Aug 18, 2016

thanks mato, the console examples work fine on FreeBSD with this change (still no virtio on FreeBSD due to lack of time to investigate)!

@mato
Copy link
Copy Markdown
Member Author

mato commented Aug 18, 2016

@hannesm Thanks for testing. Merging...

@pqwy
Copy link
Copy Markdown

pqwy commented Aug 18, 2016

Awesome work, thanks!

@mato mato deleted the memory-layout-fixes branch August 26, 2016 15:27
@mato mato mentioned this pull request Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants