Update bootstrap to edition 2024
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
name = "bootstrap"
|
||||
version = "0.0.0"
|
||||
authors = ["4lDO2 <4lDO2@protonmail.com>"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
|
||||
[lib]
|
||||
|
||||
@@ -58,7 +58,7 @@ pub fn main() -> ! {
|
||||
iter().map(|var| var.to_owned()).collect::<Vec<_>>()
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
unsafe extern "C" {
|
||||
// The linker script will define this as the location of the initfs header.
|
||||
static __initfs_header: u8;
|
||||
}
|
||||
|
||||
@@ -344,22 +344,22 @@ pub fn run(bytes: &'static [u8], sync_pipe: usize) -> ! {
|
||||
// TODO: Restructure bootstrap so it calls into relibc, or a split-off derivative without the C
|
||||
// parts, such as "redox-rt".
|
||||
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_read_v1(fd: usize, ptr: *mut u8, len: usize) -> isize {
|
||||
Error::mux(syscall::read(fd, core::slice::from_raw_parts_mut(ptr, len))) as isize
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_write_v1(fd: usize, ptr: *const u8, len: usize) -> isize {
|
||||
Error::mux(syscall::write(fd, core::slice::from_raw_parts(ptr, len))) as isize
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_open_v1(ptr: *const u8, len: usize, flags: usize) -> isize {
|
||||
Error::mux(syscall::open(core::str::from_raw_parts(ptr, len), flags)) as isize
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn redox_close_v1(fd: usize) -> isize {
|
||||
Error::mux(syscall::close(fd)) as isize
|
||||
}
|
||||
|
||||
@@ -228,14 +228,14 @@ fn handle_scheme<'a>(
|
||||
awoken,
|
||||
),
|
||||
Op::Fsize { req, fd } => {
|
||||
if let Handle::Ps(ref b) = &scheme.handles[fd] {
|
||||
if let Handle::Ps(b) = &scheme.handles[fd] {
|
||||
Response::ready_ok(b.len(), req)
|
||||
} else {
|
||||
Response::ready_err(EOPNOTSUPP, req)
|
||||
}
|
||||
}
|
||||
Op::Fstat(mut op) => {
|
||||
if let Handle::Ps(ref b) = &scheme.handles[op.fd] {
|
||||
if let Handle::Ps(b) = &scheme.handles[op.fd] {
|
||||
op.buf().st_size = b.len() as _;
|
||||
op.buf().st_mode = syscall::MODE_FILE | 0o444;
|
||||
Response::ready_ok(0, op)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use syscall::flag::MapFlags;
|
||||
|
||||
mod offsets {
|
||||
extern "C" {
|
||||
unsafe extern "C" {
|
||||
// text (R-X)
|
||||
static __text_start: u8;
|
||||
static __text_end: u8;
|
||||
@@ -38,7 +38,7 @@ mod offsets {
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn start() -> ! {
|
||||
// Remap self, from the previous RWX
|
||||
|
||||
|
||||
Reference in New Issue
Block a user