KERNEL: Implementing VMM & cleaning up
Folders now are alll lower case Started working on the implementation of the Virtual memory manager. Implemented allocate and free page funtionality for as far as I can atm. Implemented the
This commit is contained in:
		
							
								
								
									
										8
									
								
								source/kernel/lib/mem.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								source/kernel/lib/mem.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
inline void* memset (void* ptr, int value, size_t num){
 | 
			
		||||
    for( int i = 0; i < num; i++ )
 | 
			
		||||
    {
 | 
			
		||||
        unsigned char* data  = (unsigned char*)ptr+ i;
 | 
			
		||||
        *data = (unsigned char)value;
 | 
			
		||||
    }
 | 
			
		||||
    return ptr;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										28
									
								
								source/kernel/lib/string.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								source/kernel/lib/string.c
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,28 @@
 | 
			
		||||
#include "string.h"
 | 
			
		||||
 | 
			
		||||
size_t strlen(const char* str) {
 | 
			
		||||
    size_t len = 0;
 | 
			
		||||
    while(str[len]){
 | 
			
		||||
        len++;
 | 
			
		||||
    }
 | 
			
		||||
    return len;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int strncmp ( const char* str1, const char* str2, size_t num ){
 | 
			
		||||
    for( int i = 0; i < num ; i++){
 | 
			
		||||
        
 | 
			
		||||
        if( str1[i] < str2[i]){
 | 
			
		||||
            return -1;
 | 
			
		||||
        } 
 | 
			
		||||
 | 
			
		||||
        if( str1[i] > str2[i] ){
 | 
			
		||||
            return 1;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										6
									
								
								source/kernel/lib/string.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								source/kernel/lib/string.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
size_t strlen(const char* str);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int strncmp ( const char* str1, const char* str2, size_t num );
 | 
			
		||||
		Reference in New Issue
	
	Block a user