Comments (7)
I have some extra logging output from the bootloader
from bootloader.
Are you using any linker arguments? For me, the default linker script without any arguments seems to always produce aligned segments.
Either way, I agree that it would be nice if the bootloader could work with non-aligned segments.
from bootloader.
Indeed, my target triple is:
{
"llvm-target": "x86_64-unknown-none",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": "64",
"target-c-int-width": "32",
"os": "none",
"executables": true,
"linker-flavor": "ld.lld",
"linker": "rust-lld",
"disable-redzone": true,
"features": "-mmx,+sse",
"panic-strategy": "unwind",
"pre-link-args": {
"ld.lld": [
"/opt/cross/lib/gcc/x86_64-elf/10.2.0/libgcc.a", "--allow-multiple-definition",
]
}
}
I need libgcc for _Unwind_*
functions (i use that for stack traces). I assume that it is due to libgcc.a having a .got section which isn't 4k-aligned.
from bootloader.
anyway i switched to multiboot2 and first edition of the guide, because i want support for modern architectures.
from bootloader.
Wait, no, i got wrong args, i do indeed have a linker script, the one found on osdev.org (https://wiki.osdev.org/Bare_Bones)
from bootloader.
i do indeed have a linker script, the one found on osdev.org (https://wiki.osdev.org/Bare_Bones)
Ah, that explains things. I think most default linker scripts align all sections properly, but a custom linker script might not. The linker script you linked does not mention any .got
section, so the linker just places it after the last section, without any special alignment.
While I still agree that it would be nice if the bootloader
crate supported non-aligned sections, section alignment is still recommended because otherwise you might not be able to set the correct write/executable permissions for these pages. For example, if .text
shares a page with .data
, that page must be mapped as both writable and executable, which is generally discouraged since attackers can easily run their injected code this way.
anyway i switched to multiboot2 and first edition of the guide, because i want support for modern architectures.
Could you clarify what you mean with "modern architectures"? Support for UEFI booting or something else? I'm currently working on a new version of the bootloader
with UEFI support, so it would be useful to know if something else is missing too.
from bootloader.
UEFI and coreboot. I know CSM is a thing, but i wouldn't rely on that. (there are some laptops that use coreboot out of the box, most notably pixelbooks and everything with System76 Open Firmware)
from bootloader.
Related Issues (20)
- Cannot boot higher-half kernel with custom linker script HOT 3
- Loading kernel is very slow HOT 8
- Memory use during build HOT 6
- Features and tests HOT 1
- Triple fault on Dell Inspiron 15 5330 HOT 11
- Hang during release build with UEFI
- Build script fails to build on latest nightly with BIOS feature enabled HOT 2
- Kernel not mapped in higher half by default? HOT 2
- After timer interrupt i have double fault. HOT 4
- Debug why `Rsdp::search_for_on_bios` is optimized to `ud2` HOT 8
- Load kernel at specific address in v0.11 HOT 6
- Compiler warnings for unused imports HOT 1
- How can I control the entry point and the address of the kernel stack using bootloader? HOT 5
- Error installing "bootimage" v 1.10.3 HOT 10
- Enable support for executing arbitrary functions in real mode HOT 6
- `No space left on device` for UEFI image with large kernel image, fixed by increasing FAT padding HOT 1
- Writing to usable memory regions causes a reboot HOT 3
- Can't compile the bootloader HOT 27
- Updating from 0.9 to 0.11 -- unresolved imports MemoryMap and MemoryRegionType HOT 2
- PageTable is not mapped as writable HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootloader.