replace nob with ms' build, move disk creation to build.bat, major comment cleanup, remove old and stupid tests, overhaul interrupt management with per-CPU vector allocation, affinity migration and safe teardown, add proper IOAPIC routing and PCI MSI/MSI-X/INTx support, migrate drivers to the new interrupt API, integrate ACPICA with a proper OS services layer, move ACPI firmware events, power button handling and S5 shutdown into acpi.sys, add parallel driver startup and atomic publication, replace PnP arrays with dynamic lists, redesign service startup again to be asynchronous, add delayed startup mode for services, allow omitting keys in services.ini, fix acpi ec deferred work handling, fix kernel threads having garbage exit code.
This commit is contained in:
1 parent
d36f19509c
commit
36eef8f58d
696 files changed
+147281
-7530
No files matched your search
@@ -0,0 +1 @@
|
||||
DIRS=doom edit httpget memtop ping resolve shell_native shell_posix shell_win32 tcpserve udp video
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <ntlite/native_heap.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <intrin.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <ntlite/native_heap.h>
|
||||
#include <string.h>
|
||||
#include <intrin.h>
|
||||
#include <ntlite/syscall.h>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=doom
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/doom/doom.c @/code/user/apps/doom/doom_audio.c
|
||||
@@ -70,7 +70,6 @@ typedef struct SCREEN_CELL {
|
||||
static SCREEN_CELL gScreenCache[MAX_SCREEN_COLS * MAX_SCREEN_ROWS];
|
||||
static bool gScreenCacheValid = false;
|
||||
|
||||
// Implements the invalidate screen cache operation.
|
||||
static void invalidate_screen_cache(void) {
|
||||
gScreenCacheValid = false;
|
||||
}
|
||||
@@ -127,7 +126,6 @@ static void draw_text(int col, int row, const char* s, uint32_t fg, uint32_t bg)
|
||||
while (*s && col < gCols) put_cell(col++, row, *s++, fg, bg);
|
||||
}
|
||||
|
||||
// Implements the msg set operation.
|
||||
static void msg_set(const char* s) {
|
||||
size_t n = strlen(s);
|
||||
if (n >= sizeof(gMessage)) n = sizeof(gMessage) - 1;
|
||||
@@ -158,7 +156,6 @@ static void append_u32(char* b, size_t cap, size_t* p, uint32_t v) {
|
||||
while (n > 0) append_char(b, cap, p, tmp[--n]);
|
||||
}
|
||||
|
||||
// Implements the key to char operation.
|
||||
static char key_to_char(INPUT_KEY key, uint32_t mods) {
|
||||
if (key >= INPUT_KEY_A && key <= INPUT_KEY_Z) {
|
||||
bool shifted = (mods & INPUT_MOD_SHIFT) != 0;
|
||||
@@ -188,7 +185,6 @@ static char key_to_char(INPUT_KEY key, uint32_t mods) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Implements the clamp cursor operation.
|
||||
static void clamp_cursor(void) {
|
||||
if (gLineCount < 1) gLineCount = 1;
|
||||
if (gCy < 0) gCy = 0;
|
||||
@@ -197,7 +193,6 @@ static void clamp_cursor(void) {
|
||||
if (gCx > gLines[gCy].len) gCx = gLines[gCy].len;
|
||||
}
|
||||
|
||||
// Implements the ensure visible operation.
|
||||
static void ensure_visible(void) {
|
||||
int textRows = gRows - 2;
|
||||
if (textRows < 1) textRows = 1;
|
||||
@@ -211,7 +206,6 @@ static void ensure_visible(void) {
|
||||
if (gLeft < 0) gLeft = 0;
|
||||
}
|
||||
|
||||
// Implements the render operation.
|
||||
static void render(void) {
|
||||
update_screen_size();
|
||||
|
||||
@@ -275,7 +269,6 @@ static void insert_char_at_cursor(char c) {
|
||||
gDirty = true;
|
||||
}
|
||||
|
||||
// Implements the newline at cursor operation.
|
||||
static void newline_at_cursor(void) {
|
||||
if (gLineCount >= MAX_LINES) { msg_set("too many lines"); return; }
|
||||
|
||||
@@ -297,7 +290,6 @@ static void newline_at_cursor(void) {
|
||||
gDirty = true;
|
||||
}
|
||||
|
||||
// Implements the backspace at cursor operation.
|
||||
static void backspace_at_cursor(void) {
|
||||
if (gCx > 0) {
|
||||
LINE* ln = &gLines[gCy];
|
||||
@@ -401,7 +393,6 @@ static void save_file(void) {
|
||||
msg_set("saved");
|
||||
}
|
||||
|
||||
// Implements the reset buffer operation.
|
||||
static void reset_buffer(void) {
|
||||
gLineCount = 1;
|
||||
gLines[0].len = 0;
|
||||
@@ -450,13 +441,11 @@ static void load_file(void) {
|
||||
msg_set(truncated ? "loaded, truncated long file" : "loaded");
|
||||
}
|
||||
|
||||
// Implements the skip spaces operation.
|
||||
static const char* skip_spaces(const char* s) {
|
||||
while (s && (*s == ' ' || *s == '\t')) s++;
|
||||
return s;
|
||||
}
|
||||
|
||||
// Implements the skip token operation.
|
||||
static const char* skip_token(const char* s) {
|
||||
s = skip_spaces(s);
|
||||
if (!s || !*s) return s;
|
||||
@@ -500,7 +489,6 @@ static void parse_filename_from_cmdline(void) {
|
||||
strcpy(gFilename, "untitled.txt");
|
||||
}
|
||||
|
||||
// Implements the editor loop operation.
|
||||
static void editor_loop(void) {
|
||||
while (true) {
|
||||
render();
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=edit
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/edit/edit.c
|
||||
@@ -58,7 +58,6 @@ static void append_u8(char* dst, size_t cap, size_t* off, uint8_t v) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the format ipv4 operation.
|
||||
static void format_ipv4(char* dst, size_t cap, const uint8_t ip[4]) {
|
||||
size_t off = 0;
|
||||
if (!dst || cap == 0) return;
|
||||
@@ -81,7 +80,6 @@ static void append_hex16(char* dst, size_t cap, size_t* off, uint16_t value) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the format ipv6 operation.
|
||||
static void format_ipv6(char* dst, size_t cap, const uint8_t ip[16]) {
|
||||
size_t off = 0;
|
||||
if (!dst || cap == 0) return;
|
||||
@@ -93,7 +91,6 @@ static void format_ipv6(char* dst, size_t cap, const uint8_t ip[16]) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the format socket address operation.
|
||||
static void format_socket_address(char* dst, size_t cap, const SYS_SOCKET_ADDRESS* address) {
|
||||
if (!address || address->Family == SYS_AF_INET)
|
||||
format_ipv4(dst, cap, address ? address->Address : (const uint8_t*)"\0\0\0\0");
|
||||
@@ -131,7 +128,6 @@ static bool parse_ipv4(const char* s, uint8_t ip[4]) {
|
||||
return *s == 0;
|
||||
}
|
||||
|
||||
// Implements the next token operation.
|
||||
static const char* next_token(const char* s, char* out, size_t outSize) {
|
||||
if (!s || !out || outSize == 0) return NULL;
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
@@ -146,13 +142,11 @@ static const char* next_token(const char* s, char* out, size_t outSize) {
|
||||
return s;
|
||||
}
|
||||
|
||||
// Implements the usage operation.
|
||||
static void usage(void) {
|
||||
print("usage: httpget.exe [host-or-ipv4] [path]\n");
|
||||
print("default: httpget.exe 10.0.2.2 /\n");
|
||||
}
|
||||
|
||||
// Implements the resolve host operation.
|
||||
static KSTATUS resolve_host(const char* host, SYS_SOCKET_ADDRESS* address) {
|
||||
uint8_t ip[4];
|
||||
if (parse_ipv4(host, ip)) {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=httpget
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/httpget/httpget.c
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=memtop
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/memtop/memtop.c
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -53,7 +53,6 @@ static void print_rtt_us(uint64_t us) {
|
||||
print_u64(frac);
|
||||
}
|
||||
|
||||
// Implements the format ipv4 operation.
|
||||
static void format_ipv4(char* out, size_t outSize, const uint8_t ip[4]) {
|
||||
if (!out || outSize == 0) return;
|
||||
size_t off = 0;
|
||||
@@ -70,7 +69,6 @@ static void format_ipv4(char* out, size_t outSize, const uint8_t ip[4]) {
|
||||
out[off < outSize ? off : outSize - 1] = 0;
|
||||
}
|
||||
|
||||
// Implements the next token operation.
|
||||
static const char* next_token(const char* s, char* out, size_t outSize) {
|
||||
if (!s || !out || outSize == 0) return NULL;
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
@@ -130,7 +128,6 @@ static bool parse_u32(const char* s, uint32_t* out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Implements the resolve host operation.
|
||||
static KSTATUS resolve_host(const char* host, uint8_t ip[4]) {
|
||||
if (parse_ipv4(host, ip))
|
||||
return NTLSTATUS_SUCCESS;
|
||||
@@ -159,7 +156,6 @@ static KSTATUS resolve_host(const char* host, uint8_t ip[4]) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the icmp checksum operation.
|
||||
static uint16_t icmp_checksum(const uint8_t* data, size_t length) {
|
||||
uint32_t sum = 0;
|
||||
while (length >= 2) {
|
||||
@@ -223,7 +219,6 @@ static bool parse_echo_reply(const uint8_t* buf, size_t len, uint16_t ident, uin
|
||||
return false;
|
||||
}
|
||||
|
||||
// Implements the usage operation.
|
||||
static void usage(void) {
|
||||
print("usage: apps/ping.exe [host-or-ipv4] [count]\n");
|
||||
print("default: apps/ping.exe 10.0.2.2 4\n");
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=ping
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/ping/ping.c
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -29,7 +29,6 @@ static void print_u64(uint64_t v) {
|
||||
while (n > 0) print_char(buf[--n]);
|
||||
}
|
||||
|
||||
// Implements the next token operation.
|
||||
static const char* next_token(const char* s, char* out, size_t outSize) {
|
||||
if (!s || !out || outSize == 0) return NULL;
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=resolve
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/resolve/resolve.c
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -128,7 +128,6 @@ static void printUInt64(uint64_t n) {
|
||||
while (i > 0) { char c[2] = { buf[--i], '\0' }; print(c); }
|
||||
}
|
||||
|
||||
// Implements the u64 Digits operation.
|
||||
static uint32_t u64Digits(uint64_t n) {
|
||||
uint32_t digits = 1;
|
||||
while (n >= 10u) { n /= 10u; digits++; }
|
||||
@@ -833,7 +832,6 @@ static bool readLine(char* buf, int len) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Implements the trim operation.
|
||||
static char* trim(char* s) {
|
||||
while (*s == ' ') s++;
|
||||
int len = (int)strlen(s);
|
||||
@@ -1001,7 +999,6 @@ static void cmd_volume(const char* args) {
|
||||
print("\n");
|
||||
}
|
||||
|
||||
// Implements the cmd stats operation.
|
||||
static void cmd_stats(void) {
|
||||
SYS_SCHEDULER_STATS sched;
|
||||
SYS_PMM_STATS pmm;
|
||||
@@ -1416,7 +1413,6 @@ static void cmd_stats(void) {
|
||||
SysFreeVm(cpuBuffer);
|
||||
}
|
||||
|
||||
// Implements the cmd time operation.
|
||||
static void cmd_time(void) {
|
||||
SYS_SYSTEM_TIME t;
|
||||
KSTATUS status = SysGetSystemTime(&t);
|
||||
@@ -1476,7 +1472,6 @@ static void printDisplayStats(const char* title, const DISPLAY_STATS* st) {
|
||||
print(" hide="); printUInt64(st->CursorHideCount); print("\n");
|
||||
}
|
||||
|
||||
// Implements the cmd display operation.
|
||||
static void cmd_display(void) {
|
||||
SYS_DISPLAY_INFO info;
|
||||
KSTATUS status = SysQueryDisplayInfo(&info);
|
||||
@@ -1673,7 +1668,6 @@ static void cmd_surfbench(void) {
|
||||
shellPrintFramebufferBenchmark("full", &full);
|
||||
}
|
||||
|
||||
// Implements the cmd mem operation.
|
||||
static void cmd_mem(void) {
|
||||
SYS_MEMORY_STATUS st;
|
||||
if (SysGetMemoryStatus(&st) != 0) {
|
||||
@@ -1767,7 +1761,6 @@ static void printThreadFlags(uint32_t flags) {
|
||||
printStringWidth(buf, 7);
|
||||
}
|
||||
|
||||
// Implements the cmd ps operation.
|
||||
static void cmd_ps(void) {
|
||||
SYS_PROCESS_INFO procs[MAX_PROCS];
|
||||
size_t count = 0;
|
||||
@@ -1825,7 +1818,6 @@ static void cmd_ps(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the cmd threads operation.
|
||||
static void cmd_threads(const char* args) {
|
||||
uint32_t pid = 0;
|
||||
if (!parseUInt(args, &pid)) {
|
||||
@@ -1922,7 +1914,6 @@ static void cmd_kill(const char* args) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the cmd write operation.
|
||||
static void cmd_write(const char* args) {
|
||||
char filename[MAX_CMD]; int i = 0;
|
||||
while (args[i] != ' ' && args[i] != '\0' && i < MAX_CMD - 1) {
|
||||
@@ -2083,7 +2074,6 @@ static bool shellTryResourceDir(const char* target) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Implements the cmd dir operation.
|
||||
static void cmd_dir(const char* path) {
|
||||
uint32_t hDir;
|
||||
const char* target = (path && *path != '\0') ? path : ".";
|
||||
@@ -2131,7 +2121,6 @@ static void cmd_dir(const char* path) {
|
||||
SysFreeVm(entries);
|
||||
}
|
||||
|
||||
// Implements the cmd type operation.
|
||||
static void cmd_type(const char* filename) {
|
||||
uint32_t hFile;
|
||||
if (open_file(filename, &hFile) != 0) { print("type: cannot open file\n"); return; }
|
||||
@@ -2144,7 +2133,6 @@ static void cmd_type(const char* filename) {
|
||||
SysCloseHandle(hFile); print("\n");
|
||||
}
|
||||
|
||||
// Implements the extract Program Path operation.
|
||||
static bool extractProgramPath(const char* cmdline, char* out, size_t outSize) {
|
||||
if (!cmdline || !out || outSize == 0) return false;
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=shell_native
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/shell_native/shell_native.c
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -37,7 +37,6 @@ static void readLine(char* buf, int len) {
|
||||
buf[pos] = '\0';
|
||||
}
|
||||
|
||||
// Implements the split Command Line operation.
|
||||
static int splitCommandLine(char* line, char** argv, int maxArgv) {
|
||||
int argc = 0;
|
||||
char* p = line;
|
||||
@@ -62,7 +61,6 @@ static int splitCommandLine(char* line, char** argv, int maxArgv) {
|
||||
return argc;
|
||||
}
|
||||
|
||||
// Implements the trim operation.
|
||||
static char* trim(char* s) {
|
||||
while (*s == ' ') s++;
|
||||
int len = (int)strlen(s);
|
||||
@@ -71,7 +69,6 @@ static char* trim(char* s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
// Implements the cmd help operation.
|
||||
static void cmd_help() {
|
||||
print("Available commands:\n"
|
||||
" help - Show this list\n"
|
||||
@@ -86,7 +83,6 @@ static void cmd_help() {
|
||||
" exit - Close the shell\n");
|
||||
}
|
||||
|
||||
// Implements the cmd write operation.
|
||||
static void cmd_write(const char* args) {
|
||||
char filename[MAX_CMD]; int i = 0;
|
||||
while (args[i] != ' ' && args[i] != '\0' && i < MAX_CMD - 1) {
|
||||
@@ -145,7 +141,6 @@ static void shellSortDirEntries(SHELL_POSIX_DIR_ENTRY* entries, size_t count) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the cmd dir operation.
|
||||
static void cmd_dir(const char* path) {
|
||||
const char* target = (path && *path != '\0') ? path : ".";
|
||||
DIR* d = opendir(target);
|
||||
@@ -186,7 +181,6 @@ static void cmd_dir(const char* path) {
|
||||
free(entries);
|
||||
}
|
||||
|
||||
// Implements the cmd type operation.
|
||||
static void cmd_type(const char* filename) {
|
||||
int fd = open(filename, 0); // O_RDONLY
|
||||
if (fd < 0) { print("type: cannot open file\n"); return; }
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=shell_posix
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=POSIX
|
||||
TARGETLIBS="$(BASEDIR)\bin\posix.lib" "$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\posix_start.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:PosixStart
|
||||
SOURCES=@/code/user/apps/shell_posix/shell_posix.c
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -58,7 +58,6 @@ static void readLine(char* buf, int len) {
|
||||
buf[pos] = '\0';
|
||||
}
|
||||
|
||||
// Implements the trim operation.
|
||||
static char* trim(char* s) {
|
||||
while (*s == ' ') s++;
|
||||
int len = (int)strlen(s);
|
||||
@@ -82,7 +81,6 @@ static void cmd_help() {
|
||||
" exit - Close the shell\n");
|
||||
}
|
||||
|
||||
// Implements the cmd write operation.
|
||||
static void cmd_write(const char* args) {
|
||||
char filename[MAX_PATH]; int i = 0;
|
||||
while (args[i] != ' ' && args[i] != '\0' && i < MAX_PATH - 1) {
|
||||
@@ -145,7 +143,6 @@ static void shellSortDirEntries(SHELL_WIN32_DIR_ENTRY* entries, size_t count) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the cmd dir operation.
|
||||
static void cmd_dir(const char* path) {
|
||||
WIN32_FIND_DATAA fd;
|
||||
char search_path[MAX_PATH];
|
||||
@@ -200,7 +197,6 @@ static void cmd_dir(const char* path) {
|
||||
HeapFree(heap, 0, entries);
|
||||
}
|
||||
|
||||
// Implements the cmd type operation.
|
||||
static void cmd_type(const char* filename) {
|
||||
HANDLE hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
|
||||
if (hFile == INVALID_HANDLE_VALUE) { print("type: cannot open file\n"); return; }
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=shell_win32
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\win32.lib" "$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/shell_win32/shell_win32.c
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=tcpserve
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/tcpserve/tcpserve.c
|
||||
@@ -70,7 +70,6 @@ static void print_socket_address(const SYS_SOCKET_ADDRESS* address) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the next token operation.
|
||||
static const char* next_token(const char* s, char* out, size_t outSize) {
|
||||
if (!s || !out || outSize == 0) return NULL;
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
@@ -99,7 +98,6 @@ static bool parse_port(const char* s, uint16_t* out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Implements the usage operation.
|
||||
static void usage(void) {
|
||||
print("usage: tcpserve.exe [-4|-6] [port]\n");
|
||||
print("default: tcpserve.exe 8080\n");
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=udp
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/udp/udp.c
|
||||
@@ -70,7 +70,6 @@ static void print_socket_address(const SYS_SOCKET_ADDRESS* address) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the next token operation.
|
||||
static const char* next_token(const char* s, char* out, size_t outSize) {
|
||||
if (!s || !out || outSize == 0) return NULL;
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
@@ -129,7 +128,6 @@ static bool parse_port(const char* s, uint16_t* out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Implements the usage operation.
|
||||
static void usage(void) {
|
||||
print("usage:\n");
|
||||
print(" udp.exe send <host|address> <port> [message]\n");
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
!include $(BASEDIR)\makefile.def
|
||||
@@ -0,0 +1,7 @@
|
||||
TARGETNAME=video
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=PROGRAM
|
||||
FLAVOR=USER
|
||||
TARGETLIBS="$(BASEDIR)\bin\syscall.lib" "$(BASEDIR)\bin\libc.lib" "$(BASEDIR)\bin\native_runtime.lib" "$(BASEDIR)\code\user\apps\video\bink2w64.lib"
|
||||
EXTRA_LFLAGS=/ENTRY:NtlNativeStart
|
||||
SOURCES=@/code/user/apps/video/video.c
|
||||
Reference in new issue
Block a user