mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:37:45 +00:00
Kernel: Move aarch64 Prekernel into Kernel
As there is no need for a Prekernel on aarch64, the Prekernel code was moved into Kernel itself. The functionality remains the same. SERENITY_KERNEL_AND_INITRD in run.sh specifies a kernel and an inital ramdisk to be used by the emulator. This is needed because aarch64 does not need a Prekernel and the other ones do.
This commit is contained in:
parent
f94293f121
commit
6d2c298b66
37 changed files with 126 additions and 133 deletions
38
Kernel/Arch/aarch64/BootPPMParser.h
Normal file
38
Kernel/Arch/aarch64/BootPPMParser.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Marcin Undak <mcinek@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
|
||||
namespace Prekernel {
|
||||
|
||||
// Quick parser for .ppm image format (raw PortablePixMap)
|
||||
// This is much simpler version than userland implementation in PPMLoader.cpp
|
||||
class BootPPMParser {
|
||||
public:
|
||||
struct {
|
||||
u32 width = 0;
|
||||
u32 height = 0;
|
||||
u8 const* pixel_data = nullptr;
|
||||
} image;
|
||||
|
||||
BootPPMParser(u8 const* buffer, u32 buffer_size);
|
||||
|
||||
bool parse();
|
||||
|
||||
private:
|
||||
char const* m_cursor;
|
||||
char const* m_buffer_end;
|
||||
|
||||
bool check_position() const;
|
||||
bool parse_magic();
|
||||
bool parse_new_line();
|
||||
bool parse_comment();
|
||||
bool parse_integer(u32& value);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue