Skip to content

Latest commit

 

History

History
113 lines (98 loc) · 4.45 KB

PIDI-DIFF.md

File metadata and controls

113 lines (98 loc) · 4.45 KB

Pidi-Diff

There are many differences between pidi-os, these are listed below in the form of:

Additions

Many more extra commands for the userland, such as:

Additions for already existing commands, such as:

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:

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
  • 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).
  • conv
    • Add a str_to_int function (for userland programs like calc)
    • Add more (and better) macros
  • 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 (is char also valid int?)
  • 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..?

Bug Fixes

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();