Skip to content

Commit 1da9b3e

Browse files
committed
update kklibc
1 parent 1486f11 commit 1da9b3e

6 files changed

Lines changed: 20 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
commit 1486f11d21b520f4ccfef81c45248c81c26511d8
2+
Author: Alexeev Bronislav <alexeev.dev@mail.ru>
3+
Date: Wed Aug 27 04:08:34 2025 +0700
4+
5+
update docs
6+
17
commit bcde3a3da901d2bfdc91c09f64e6d1a062a1808f
28
Author: Alexeev Bronislav <alexeev.dev@mail.ru>
39
Date: Wed Aug 27 01:16:27 2025 +0700

src/kernel/kernel/kernel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "../kklibc/paging.h"
1414
#include "_default.h"
1515
#include "utils.h"
16+
#include "sysinfo.h"
1617

1718
#define MAX_ARGS 32
1819

@@ -31,6 +32,11 @@ void kmain() {
3132
initialise_paging();
3233
heap_init();
3334

35+
detect_cpu();
36+
kprint("CPU detected\n");
37+
detect_memory();
38+
kprint("Memory Detected\n");
39+
3440
// Приглашение
3541
printf("\nKintsugi OS %s (C) 2025\nRepository: " "https://github.com/alexeev-prog/KintsugiOS\n", VERSION);
3642

src/kernel/kernel/sysinfo.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void detect_memory() {
3131
sys_info.total_memory = nframes * PAGE_SIZE;
3232
sys_info.free_memory = 0;
3333

34-
// подсчет свободныъ фреймов
34+
// подсчет свободных фреймов
3535
for (u32 i = 0; i < nframes; i++) {
3636
if (!test_frame(i * PAGE_SIZE)) {
3737
sys_info.free_memory += PAGE_SIZE;
@@ -44,7 +44,5 @@ void detect_memory() {
4444
}
4545

4646
system_info_t* get_system_info() {
47-
detect_cpu();
48-
detect_memory();
4947
return &sys_info;
5048
}

src/kernel/kklibc/mem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "ctypes.h"
1212

1313
#define HEAP_START 0x100000 // Начинаем кучу с 1 МБ (выше ядра)
14-
#define HEAP_SIZE 0x100000 // Размер кучи: 1 МБ
14+
#define HEAP_SIZE 0x1000000 // Размер кучи: 1 МБ
1515
#define BLOCK_SIZE 16 // Минимальный размер блока
1616

1717
typedef struct mem_block {

src/kernel/kklibc/stdlib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
* Title: Стандартный набор методов
55
* Description: null
66
* ----------------------------------------------------------------------------*/
7-
#include "stdlib.h"
87

98
#include "ctypes.h"
109
#include "stdio.h"
10+
#include "stdlib.h"
1111

1212
void booltochar(u8 value, u8* str) {
1313
if (value) {
@@ -443,7 +443,7 @@ char* strstr(const char* haystack, const char* needle) {
443443
}
444444

445445
// Вспомогательная функция для форматирования строки с ограничением размера
446-
static int vsnprintf(char* buf, unsigned int size, const char* fmt, va_list args) {
446+
int vsnprintf(char* buf, unsigned int size, const char* fmt, va_list args) {
447447
unsigned int i = 0;
448448
char num_buf[32];
449449
char c;
@@ -626,3 +626,4 @@ void* memchr(const void* ptr, int c, u32 n) {
626626

627627
return NULL;
628628
}
629+

src/kernel/kklibc/stdlib.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define STDLIB_H
1111

1212
#include "ctypes.h"
13+
#include "stdio.h"
1314

1415
/*******************************************************************************
1516
* Преобразования данных
@@ -314,6 +315,8 @@ int sprintf(char* buf, const char* fmt, ...);
314315
*/
315316
int snprintf(char* buf, unsigned int size, const char* fmt, ...);
316317

318+
int vsnprintf(char* buf, unsigned int size, const char* fmt, va_list args);
319+
317320
/*******************************************************************************
318321
* Управление системой
319322
******************************************************************************/

0 commit comments

Comments
 (0)