WKern
Loading...
Searching...
No Matches
testexec.c
Go to the documentation of this file.
1/*
2WKern - A Bare Metal OS / Kernel I am maKing (For Fun)
3Copyright (C) 2025 Wdboyes13
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19// This is a test executable of the WEX format
20// The data would be in an actual file normally
21// This is just an array to simulate it
22static unsigned char exec[] = {
23 0x06, 0x04, // Entry point = 0x06, Symbol Table Size = 4
24 0x0A, 0x0C, 0x0D, 0x01, // Symbol Table: [0]=Write, [1]=Shutdown, [2]=Sleep,
25 // [3]=CLS
26
27 0x00, 0x03, // CALL CLS (smt[3] = 0x01)
28 0x00, 0x00, 'H', 'E', 'L', 'L', 'O', '\n', 0x00, 0x00,
29 0x02, // CALL SLEEP (smt[2] = 0x0D)
30 0x00, 0x01, // CALL SHUTDOWN (smt[1] = 0x0C)
31
32 0xFF // End of program
33};
34unsigned char *Execr() { return exec; }
unsigned char * Execr()
Definition testexec.c:34