XenevaOS
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
ramdisk.c File Reference
#include "ramdisk.h"
#include "dtb.h"
#include "physm.h"
#include "ctype.h"
#include "vmmngr.h"
#include "pe.h"
#include "aurora.h"
Include dependency graph for ramdisk.c:

Macros

#define SECTOR_SIZE   512
 
#define FAT_EOC_MARK   0xFFFFFFF8
 

Typedefs

typedef void(* entry) ()
 

Functions

void LBRamdiskReadSector (uint32_t lba, size_t counts, uint8_t *buffer)
 
struct __attribute__ ((packed))
 
uint64_t FatClusterToSector (uint64_t cluster)
 
void FatToDOSFilename (const char *filename, char *fname, unsigned int fname_len)
 
uint32_t ExtractEFICluster ()
 
uint32_t ExtractXeneva (uint32_t parentCluster)
 
uint64_t align_to_page (uint64_t size)
 
uint32_t ExtractKernel (uint32_t parentClust)
 
uint32_t FatReadFAT (uint64_t clusterIndex)
 
void ReadKernelFile (uint32_t firstCluster)
 
void LoadKernelFile ()
 
void LBRamdiskInitialize ()
 
void LBRamdiskJumpToKernel (uint64_t stack, size_t stacksz, KERNEL_BOOT_INFO *info)
 
uint64_t LBRamdiskGetStartAddress ()
 
uint64_t LBRamdiskGetEndAddress ()
 

Variables

uint64_t ramdisk_start
 
uint64_t ramdisk_end
 
uint64_t sectorPerCluster
 
uint64_t RootSector
 
uint64_t ClusterBeginLBA
 
uint64_t sectPerFAT32
 
uint64_t fatBeginLBA
 
uint64_t kernelSize
 
uint8_t ScratchPad [4096]
 
uint64_t kernelAddr = 0xFFFFC00000000000
 
uint64_t loadAddr = 0xFFFFD00000000000
 
uint64_t loadAddrLast
 
entry ent
 

Macro Definition Documentation

◆ FAT_EOC_MARK

#define FAT_EOC_MARK   0xFFFFFFF8

◆ SECTOR_SIZE

#define SECTOR_SIZE   512

Typedef Documentation

◆ entry

typedef void(* entry) ()

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

◆ align_to_page()

uint64_t align_to_page ( uint64_t  size)

◆ ExtractEFICluster()

uint32_t ExtractEFICluster ( )

◆ ExtractKernel()

uint32_t ExtractKernel ( uint32_t  parentClust)

◆ ExtractXeneva()

uint32_t ExtractXeneva ( uint32_t  parentCluster)

◆ FatClusterToSector()

uint64_t FatClusterToSector ( uint64_t  cluster)

◆ FatReadFAT()

uint32_t FatReadFAT ( uint64_t  clusterIndex)

◆ FatToDOSFilename()

void FatToDOSFilename ( const char *  filename,
char *  fname,
unsigned int  fname_len 
)

FatToDOSFilename – converts a given filename to MSDOS file name format

Parameters
filename– filename for conversion
fname– pointer to the buffer to store the conversion
fname_length– manly 11 buffer[0-8] – filename, buffer[9-11] – file extension

◆ LBRamdiskGetEndAddress()

uint64_t LBRamdiskGetEndAddress ( )

◆ LBRamdiskGetStartAddress()

uint64_t LBRamdiskGetStartAddress ( )

◆ LBRamdiskInitialize()

void LBRamdiskInitialize ( )

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ LBRamdiskJumpToKernel()

void LBRamdiskJumpToKernel ( uint64_t  stack,
size_t  stacksz,
KERNEL_BOOT_INFO info 
)

◆ LBRamdiskReadSector()

void LBRamdiskReadSector ( uint32_t  lba,
size_t  counts,
uint8_t buffer 
)

◆ LoadKernelFile()

void LoadKernelFile ( )

◆ ReadKernelFile()

void ReadKernelFile ( uint32_t  firstCluster)

Variable Documentation

◆ ClusterBeginLBA

uint64_t ClusterBeginLBA

◆ ent

entry ent

◆ fatBeginLBA

uint64_t fatBeginLBA

◆ kernelAddr

uint64_t kernelAddr = 0xFFFFC00000000000

◆ kernelSize

uint64_t kernelSize

◆ loadAddr

uint64_t loadAddr = 0xFFFFD00000000000

◆ loadAddrLast

uint64_t loadAddrLast

◆ ramdisk_end

uint64_t ramdisk_end

◆ ramdisk_start

uint64_t ramdisk_start

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ RootSector

uint64_t RootSector

◆ ScratchPad

uint8_t ScratchPad[4096]

◆ sectorPerCluster

uint64_t sectorPerCluster

◆ sectPerFAT32

uint64_t sectPerFAT32