There are many differences between pidi-os, these are listed below in the form of:
Many more extra commands for the userland, such as:
Additions for already existing commands, such as:
- pearlfetch*
*: Has been renamed.
Other things have been added to the userland, such as:
- comments (start with "#")
- better theming
- more themes
The userland has also been slightly modified, including:
- prompt (*)
- renamed commands
The scripts folder has also been modified, modifications include:
- remove useless timing script
- minimalize gencolours.py*
- update archive.sh
*: Has been renamed (color -> colour)
The stdlib of the project has been greatly improved, changes include:
- math
- Add more mathematical constants, like
e
andπ
- Add infinity, being
~(1<<31)
- Add a factorial function
- Add more mathematical constants, like
- stddef
- Add a
NULL
value ((void*)0
) - Add
size_t
type (__SIZE_TYPE__
) - Add checks for if a alue has been defined (
#ifdef
and others).
- Add a
- conv
- Add a
str_to_int
function (for userland programs likecalc
) - Add more (and better) macros
- Add a
- io
- Move to stdlib directory
- Rename functions (
kprints
->puts
)
- magic
- Add magic.h
- Add
len
macro (sizeof(x) / sizeof(*x)
)
- stdint
- Add stdint.h
- Add
chint
function (ischar
also validint
?)
- mem
- Move to stdlib directory
- Fix some comments
- Format
- Debug
Also added other, more insignificant things to for example boot.
A better configuration was added. It operates using "profiles" and these "profiles" include different configuration files. These are:
- config.h
- Includes the kernel config.
- The only C file of the group.
- config.asm
- Configs the boot sector.
- Error messages.
- kentry.asm
- Configs the entry.
- Maybe don't... Touch this one..?
I needed to be able to run the project, I couldn't have a non-functional
OS as my most prideful project, right? But when I tried compiling with gcc
(gnu17
if you're wondering), it didn't work. Instead, gcc screamed at me
about "invalid types" and other shit. So I looked at the problematic
code, here it is:
Sector* init_sector() {
/* ... */
}
Sector* fs = init_sector();
What. The. Fuck. Basically what gcc was saying was that I couldn't assign
object of type Sector*
A.K.A SectorStruct*
to object of type Sector*
.
Basically, gcc's thought process was:
Sector* fs = init_sector();
↪ Sector* fs = Sector* init_sector() { /* ... */ };
↪ Sector* fs = {returnValue};
↪ Sector* = SectorStruct*;
Sector* fs = (SectorStruct*)init_sector();
GCC thinks "Wait! Isn't Sector*
= SectorStruct*
? Yes! Changing...", but for
some reason it didn't register this with the variable type. This can be easily
solved by typecasting, but it took me a while to fix.
Sector* fs = (Sector*)init_sector();