Skip to content

Commit 2623730

Browse files
committed
Debug specific Test system call
For doing some sort of testing. Might be removed in future.
1 parent 309d7b1 commit 2623730

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

include/cm/osif.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ typedef enum OSIF_SYSCALLS {
3434
OSIF_SYSCALL_GET_OS_ERROR = 14,
3535
OSIF_SYSCALL_GET_BOOTLOADED_FILE = 15,
3636
OSIF_SYSCALL_ABORT_PROCESS = 16,
37+
OSIF_SYSCALL_TEST = 17,
3738
} OSIF_SYSCALLS;
3839

3940
typedef enum OSIF_ProcessEvents {

src/kernel/x86/syscalls.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef struct SystemcallFrame {
3232
} __attribute__ ((packed)) SystemcallFrame;
3333

3434
#if defined(DEBUG)
35+
void ksys_test (SystemcallFrame frame, U8 a, U8 b, U8 c, U8 d);
3536
void ksys_console_writeln (SystemcallFrame frame, char* fmt, char* text);
3637
#if !defined(GRAPHICS_MODE_ENABLED)
3738
void ksys_console_setcolor (SystemcallFrame frame, U8 bg, U8 fg);
@@ -113,6 +114,12 @@ void* g_syscall_table[] = {
113114
#endif
114115
//---------------------------
115116
&ksys_abortProcess, // 16
117+
//---------------------------
118+
#ifdef DEBUG
119+
&ksys_test, // 17
120+
#else
121+
&s_handleInvalidSystemCall, // 17
122+
#endif
116123
};
117124
#pragma GCC diagnostic pop
118125

@@ -218,6 +225,18 @@ static INT s_handleInvalidSystemCall()
218225
#pragma GCC diagnostic pop
219226

220227
#if defined(DEBUG)
228+
void ksys_test (SystemcallFrame frame, U8 a, U8 b, U8 c, U8 d)
229+
{
230+
FUNC_ENTRY ("Frame return address: %x:%px, a, b, c, d: {%x, %x, %x, %x}", frame.cs, frame.eip,
231+
a, b, c, d);
232+
(void)frame;
233+
(void)a;
234+
(void)b;
235+
(void)c;
236+
(void)d;
237+
238+
}
239+
221240
void ksys_console_writeln (SystemcallFrame frame, char* fmt, char* text)
222241
{
223242
FUNC_ENTRY ("Frame return address: %x:%px, fmt: %px text: %px", frame.cs, frame.eip, fmt, text);

0 commit comments

Comments
 (0)