FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
memory.h
Go to the documentation of this file.
1
9
10
11#ifndef MEMORY_H
12#define MEMORY_H
13
14#include <basics.h>
15#include <limine.h>
16
18 int64 total;
19 int64 usable;
20 int64 reserved;
21 int64 acpi_reclaimable;
22 int64 acpi_nvs;
23 int64 bad;
24 int64 bootloader_reclaimable;
25 int64 kernel_modules;
26 int64 framebuffer; // Mostly unneeded because frame buffer struct separately gives it,
27 int64 unknown; // This value must be always 0.
28};
29
41void *memcpy(void *dest, const void *src, size_t n);
42
53void *memset(void *s, int c, size_t n);
54
67void *memmove(void *dest, const void *src, size_t n);
68
80int memcmp(const void *s1, const void *s2, size_t n);
81
91void memory_dump(const void* start, const void* end);
92
100void* allocate_memory_at_address(int64 phys_addr, size_t size);
101
108
115void analyze_memory_map(struct memory_context* memory, volatile struct limine_memmap_request memory_map_request);
116
122uint64_t getCR2();
123
124#endif // MEMORY_H
This is a basic header files with FrostWing specific short forms and basically a good for life header...
uint64_t getCR2()
Returns the CR2 register.
void * memset(void *s, int c, size_t n)
Sets a block of memory to a specified value.
void * memmove(void *dest, const void *src, size_t n)
Copies a block of memory from a source location to a destination location, possibly overlapping.
int memcmp(const void *s1, const void *s2, size_t n)
Compares two blocks of memory.
void analyze_memory_map(struct memory_context *memory, volatile struct limine_memmap_request memory_map_request)
Reads the Limine memory map and saves to an usable context.
void * memcpy(void *dest, const void *src, size_t n)
Copies a block of memory from a source location to a destination location.
void memory_dump(const void *start, const void *end)
Dump memory content from start to end.
void display_memory_formatted(struct memory_context *memory)
Display the formatted memory context.
void * allocate_memory_at_address(int64 phys_addr, size_t size)
Allocates memory at an specific address.