-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemory.h
More file actions
32 lines (25 loc) · 825 Bytes
/
Copy pathmemory.h
File metadata and controls
32 lines (25 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef MEMORY_H
#define MEMORY_H
#include <stdint.h>
#include <stddef.h>
#include "multiboot2.h"
typedef struct {
uint32_t eax_reg;
multiboot_info_t* ebx_reg;
} __attribute__((packed)) multiboot_data_t;
extern multiboot_data_t multiboot_data;
// Function to initialize memory
// void memory_initialize();
// Memory allocation functions
// void *memalloc(size_t size);
// void memfree(void *ptr);
void *memset(void *ptr, int value, size_t num);
void *memcpy(void *dest, const void *src, size_t n);
// Function to calculate total system memory
// uint32_t get_total_memory();
// Simple memory region structure for heap management
typedef struct block_header {
size_t size; // Size of the block
struct block_header *next; // Pointer to the next block in the free list
} block_header_t;
#endif