Closed ghost closed 9 years ago
@mpe5651 @Blackjack92 I'm not sure about function 2.) Should the kernel really be responsible for managing the current working directory. Shouldn't we introduce some kind of FileManager
which is responsible for this (and more ofc). Pls provide your oppinions.
I have implemented KernelTick(int)
which counts up the uptime ticks and returns the new value.
Above commit implements KernelInfo
, KernelError
and KernelDebug
. Those functions should be used to print to the console within the kernel functions. The interface is equivalent to the printf
function, therefore something like below is possible:
KernelInfo("Variable i=%i\n", i);
The implemented functions also use a mutex to guarantee correct output.
am I right in the assumption that kernelExecute is for system calls? in that case, implementing this function is done simply by calling a swi with a a appropriate sysCall number.
KernelExecute
is meant to be a function which starts an external program/command, e.g. KernelExecute("uptime");
starts an external or internal process which prints the uptime. Other examples are KernelExecute("ls"),
KernelExecute("more KernelExecute(..)
just searches for an executable in a specified folder and runs the corresponding program. At the moment we should compile some core processes into the kernel, such as uptime
.
I found an issue with the implemented functions for printing out debug/error/info stuff. These functions use a mutex to ensure ordered output, however, in some cases this weirdly freezes the kernel as most of these functions are called within interrupt handlers which should not be locked :)
Above commit solves the mutex issue.
I would appreciate the FileManager idea. Some instance should handle the current directory with the contained files.
The print functions of the Kernel should be wrapped into some conditional statements to allow disabling debug and error output in release mode.
Above commit introduces #define
s in kernel.c
which allow to control the output level of kernel messages.
We should move the KernelExecute(..)
function completely to the FileManager implementation.
Edit: Nope :)
This ticket is solved.
The kernel should provide functions like:
1.)
3.)KernelGetUptime()
4.)KernelExecute(char* command)
should print info message, providing the same interface asKernelInfo(...)
printf
5.)should print debug message 6.)KernelDebug(...)
should print error message 7.)KernelError(...)
should count up the ticks by parameter (uptime)KernelTick(int)