put placeholders to handle inis in phase1

This commit is contained in:
bunnie 2024-04-01 15:29:23 +08:00
parent cb7cbd9357
commit e5ecdc88f5

View file

@ -147,6 +147,7 @@ pub fn copy_args(cfg: &mut BootConfig) {
enum TagType { enum TagType {
IniE, IniE,
IniF, IniF,
IniS,
XKrn, XKrn,
Other, Other,
} }
@ -156,6 +157,8 @@ impl From<u32> for TagType {
TagType::IniE TagType::IniE
} else if code == u32::from_le_bytes(*b"IniF") { } else if code == u32::from_le_bytes(*b"IniF") {
TagType::IniF TagType::IniF
} else if code == u32::from_le_bytes(*b"IniS") {
TagType::IniS
} else if code == u32::from_le_bytes(*b"XKrn") { } else if code == u32::from_le_bytes(*b"XKrn") {
TagType::XKrn TagType::XKrn
} else { } else {
@ -169,6 +172,7 @@ impl TagType {
match self { match self {
TagType::IniE => "IniE", TagType::IniE => "IniE",
TagType::IniF => "IniF", TagType::IniF => "IniF",
TagType::IniS => "IniS",
TagType::XKrn => "XKrn", TagType::XKrn => "XKrn",
TagType::Other => "Other", TagType::Other => "Other",
} }
@ -314,6 +318,17 @@ fn copy_processes(cfg: &mut BootConfig) {
} }
println!("Done with sections"); println!("Done with sections");
} }
TagType::IniS => {
// IniS does not necessarily exist in linear memory space.
// TODO: access IniS image and figure out what regions are "write" and allocate/copy
// those into RAM. We do this because there isn't a 1:1 mapping of these to the
// images on disk which creates a problem for the swapper.
// Then, for regions that *are* aligned, allocate them into the swapper's
// memory space, and copy the data into swap.
todo!("implement inis handling");
}
TagType::XKrn => { TagType::XKrn => {
let prog = unsafe { &*(tag.data.as_ptr() as *const ProgramDescription) }; let prog = unsafe { &*(tag.data.as_ptr() as *const ProgramDescription) };