Completed project tree and folder descriptions

This commit is contained in:
Julian Barathieu 2018-12-27 15:04:31 +01:00
parent fdcf18e988
commit 974bbba221
15 changed files with 126 additions and 49 deletions

View File

@ -41,8 +41,11 @@
# define unlikely(x) __builtin_expect((x), 0) # define unlikely(x) __builtin_expect((x), 0)
#endif #endif
#ifdef _KALEID_KERNEL
# include "kernel/config.h"
#endif
#include "common/types.h" #include "common/types.h"
#include "common/config.h"
#include "common/atomic.h" #include "common/atomic.h"
#include "common/status.h" #include "common/status.h"
#include "common/assert.h" #include "common/assert.h"

View File

@ -1 +1,41 @@
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Authors: spectral` //
// NeoX //
// //
// Desc: Folder description - "kaleid/common" //
//----------------------------------------------------------------------------//
This is the folder containing the sources for Kaleid's C runtime library, linked both to the kernel
and to the system processes that run outiside the kernel. It can also be compiled for Linux as
(very basic) C library, for test purposes.
This folder contains the following files:
- common.h
This file is to be included by every source file using the library, and it includes in turn
the following files:
- assert.h
Defines the macro "assert()". Currently any program wanting to use this macro has to
implement its own "___assert_handler(const char *cond, const char *file, int line, const char *func)"
but an (overridable) default handler will be furnished in the future.
- atomic.h
Support for atomic operations. When compiled by the kernel, also furnishes macros for
enabling/disabling interrupts. This will change in the future.
- status.h
Defines the different values of the "status_t" type used throughout Kaleid and related
utilitary functions.
- types.h
Provides the elementary types (size_t, etc) used throught Kaleid.
- convert.h
Contains the declaration of conversion utilities (e.g. itoa())
It is included by string.h
- memory.h
Contains the declaration of the mem*() family of utilities (e.g. memcpy())
- string.h
Contains the declaration of various string-related utilities (including the sprintf() family)
Includes convert.h

View File

@ -15,6 +15,10 @@
# include "common/common.h" # include "common/common.h"
#endif #endif
#ifndef _KALCOMM_CONVERT_H
# include "common/convert.h"
#endif
#ifndef _OSK_SOURCE #ifndef _OSK_SOURCE
# define strlen _osk_strlen # define strlen _osk_strlen

View File

@ -7,38 +7,30 @@
// Desc: Folder description - "kaleid/kernel" // // Desc: Folder description - "kaleid/kernel" //
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
This is the folder containing the source of Kaleid's kernel. This folder contains the source of Kaleid's kernel component.
It contains the following files: This contains the following files:
- init.c - init.c
The file containing the entry point of Kaleid, the kstart() function The file containing the entry point of Kaleid, the kstart() function
called from the bootloader (see ../../boot). called from the bootloader (see ../../boot).
This folder also has the following subfolders This folder also has the following subfolders:
(for more information on a particular subfolder, see {name}/folder.desc)
- mm/ - mm/
This folder contains all files related to memory management. This folder contains all files related to memory management.
- fs/ - fs/
This folder contains Kaleid's virtual filesystem, as well as one This folder will contain Kaleid's virtual filesystem, as well as one
subfolder for each FS supported by Kaleid (e.g. FAT filesystem). subfolder for each FS supported by Kaleid (e.g. FAT filesystem).
- io/ - io/
I/O folder. (XXX) I/O folder. (XXX)
- ps/ - ps/
This folder contains Kaleid's process manager and scheduler, as well as the This folder will contain Kaleid's process manager and scheduler, as well as the
implementation of the related syscalls and functions. implementation of the related syscalls and functions.
- ex/ - ex/
This folder contains the exec()-related functions and syscalls, as well This folder contains the exec()-related functions and syscalls, as well
as one subfolder per executable format supported by Kaleid (e.g. ELF executable) as one subfolder per executable format supported by Kaleid (e.g. ELF executable)
- se/
Security folder. (XXX)
- sys/
Syscall folder. (XXX)

View File

@ -167,7 +167,7 @@ status_t kterm_putch(struct kterm *kt, char ch)
// //
// Print string on kterminal // Print string on terminal
// //
status_t kterm_print(struct kterm *kt, const char *str) status_t kterm_print(struct kterm *kt, const char *str)
{ {

View File

@ -5,6 +5,7 @@
// NeoX // // NeoX //
// // // //
// Desc: Memory allocation routines // // Desc: Memory allocation routines //
// Only exists to trigger Neox //
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
#ifndef _KALKERN_MM_MALLOC_H #ifndef _KALKERN_MM_MALLOC_H

View File

@ -33,6 +33,8 @@ int main(int argc, char *argv[])
#undef strcpy #undef strcpy
assert(strcmp(strcpy(test2, test1), _osk_strcpy(test3, test1)) == 0); assert(strcmp(strcpy(test2, test1), _osk_strcpy(test3, test1)) == 0);
// XXX test itoa() and v?sn?printf()
// tests done // tests done
printf("2\n"); printf("2\n");

View File

@ -7,9 +7,14 @@
// Desc: Project Tree // // Desc: Project Tree //
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
// XXX *not* up to date
src/ src/
|
x COPYING
x CONTACT
x ChangeLog
|
- Makefile
- kernel.ld
| |
+ boot/ + boot/
| | | |
@ -22,7 +27,7 @@ src/
| - loader16.inc | - loader16.inc
| - loader64.inc | - loader64.inc
| | | |
| - types.h | 0
| |
+ kaleid/ + kaleid/
| | | |
@ -30,31 +35,61 @@ src/
| | | | | |
| | x folder.desc | | x folder.desc
| | | | | |
| | - config.h
| | - config.h.in
| | |
| | - init.c | | - init.c
| | - init.h | | - init.h
| | | | | |
| | + io/ | | + io/
| | | |
| | | - ports.c
| | | - ports.h
| | | |
| | | - terminal.c
| | | - terminal.h
| | | |
| | | 0
| | | | | |
| | - ports.c | | + ke/
| | - ports.h | | | |
| | - terminal.c | | | - panic.c
| | - terminal.h | | | - panic.h
| | | |
| | | 0
| | |
| | 0
| | | |
| + common/ | + common/
| | |
| | x folder.desc
| | |
| | - common.h
| | - assert.h
| | - atomic.h
| | - status.h
| | - types.h
| | |
| | - string.h
| | - memory.h
| | - convert.h
| | |
| | + lib/
| | | |
| | | - status.c
| | | |
| | | - string.c
| | | - memory.c
| | | - convert.c
| | | - sprintf.c
| | | |
| | | 0
| | 0
| | | |
| x folder.desc | + linux/
| | | | |
| - assert.h | | - test-common.c
| - atomic.h | | |
| - common.h | | 0
| - config.h | 0
| - config.h.in
| - status.h
| - string.h
| - types.h
| |
| + lib/
| |
| - string.c
|
0 0