Changes in / [0fa34dd:3e6a98c5] in mainline
- Files:
-
- 4 added
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/Makefile.inc
r0fa34dd r3e6a98c5 76 76 arch/$(KARCH)/src/proc/thread.c \ 77 77 arch/$(KARCH)/src/userspace.c \ 78 arch/$(KARCH)/src/syscall.c 78 arch/$(KARCH)/src/syscall.c \ 79 arch/$(KARCH)/src/debugger.c 79 80 80 81 ifeq ($(CONFIG_SMP),y) -
kernel/arch/amd64/src/amd64.c
r0fa34dd r3e6a98c5 43 43 #include <arch/bios/bios.h> 44 44 #include <arch/boot/boot.h> 45 #include <arch/debugger.h> 45 46 #include <arch/drivers/i8254.h> 46 47 #include <arch/drivers/i8259.h> … … 160 161 #endif 161 162 163 /* Enable debugger */ 164 debugger_init(); 162 165 /* Merge all memory zones to 1 big zone */ 163 166 zone_merge_all(); -
kernel/arch/ia32/Makefile.inc
r0fa34dd r3e6a98c5 105 105 arch/$(KARCH)/src/boot/memmap.c \ 106 106 arch/$(KARCH)/src/fpu_context.c \ 107 arch/$(KARCH)/src/debugger.c \ 107 108 arch/$(KARCH)/src/syscall.c -
kernel/arch/ia32/src/ia32.c
r0fa34dd r3e6a98c5 45 45 #include <arch/bios/bios.h> 46 46 #include <arch/boot/boot.h> 47 #include <arch/debugger.h> 47 48 #include <arch/drivers/i8254.h> 48 49 #include <arch/drivers/i8259.h> … … 117 118 #endif 118 119 120 /* Enable debugger */ 121 debugger_init(); 119 122 /* Merge all memory zones to 1 big zone */ 120 123 zone_merge_all(); -
kernel/generic/include/console/console.h
r0fa34dd r3e6a98c5 67 67 extern wchar_t getc(indev_t *indev); 68 68 extern size_t gets(indev_t *indev, char *buf, size_t buflen); 69 extern sysarg_t sys_klog(int cmd, const void *buf, size_t size);69 extern sysarg_t sys_klog(int fd, const void *buf, size_t size); 70 70 71 71 extern void grab_console(void); -
kernel/generic/src/console/console.c
r0fa34dd r3e6a98c5 52 52 #include <errno.h> 53 53 #include <str.h> 54 #include <abi/klog.h>55 54 56 55 #define KLOG_PAGES 8 … … 336 335 * 337 336 */ 338 sysarg_t sys_klog(int cmd, const void *buf, size_t size)337 sysarg_t sys_klog(int fd, const void *buf, size_t size) 339 338 { 340 339 char *data; 341 340 int rc; 342 343 switch (cmd) { 344 case KLOG_UPDATE: 345 klog_update(NULL); 346 return EOK; 347 case KLOG_WRITE: 348 case KLOG_COMMAND: 349 break; 350 default: 351 return ENOTSUP; 352 } 353 341 354 342 if (size > PAGE_SIZE) 355 343 return (sysarg_t) ELIMIT; … … 367 355 data[size] = 0; 368 356 369 switch (cmd) { 370 case KLOG_WRITE: 371 printf("%s", data); 372 break; 373 case KLOG_COMMAND: 374 for (unsigned int i = 0; i < size; i++) 375 indev_push_character(stdin, data[i]); 376 indev_push_character(stdin, '\n'); 377 break; 378 } 379 357 printf("%s", data); 380 358 free(data); 381 } 382 359 } else 360 klog_update(NULL); 361 383 362 return size; 384 363 } -
uspace/app/klog/Makefile
r0fa34dd r3e6a98c5 29 29 30 30 USPACE_PREFIX = ../.. 31 LIBS = $(LIBCLUI_PREFIX)/libclui.a32 EXTRA_CFLAGS = -I$(LIBCLUI_PREFIX)33 31 BINARY = klog 34 32 -
uspace/app/klog/klog.c
r0fa34dd r3e6a98c5 48 48 #include <adt/list.h> 49 49 #include <adt/prodcons.h> 50 #include <tinput.h>51 50 52 51 #define NAME "klog" … … 229 228 } 230 229 231 tinput_t *input = tinput_new();232 if (!input) {233 fprintf(stderr, "%s: Could not create input\n", NAME);234 return ENOMEM;235 }236 237 230 fibril_add_ready(fid); 238 231 event_unmask(EVENT_KLOG); 239 232 klog_update(); 240 233 241 tinput_set_prompt(input, "klog> "); 242 243 char *str; 244 while ((rc = tinput_read(input, &str)) == EOK) { 245 if (str_cmp(str, "") == 0) { 246 free(str); 247 continue; 248 } 249 250 klog_command(str, str_size(str)); 251 free(str); 252 } 253 254 if (rc == ENOENT) 255 rc = EOK; 256 257 return EOK; 234 task_retval(0); 235 async_manager(); 236 237 return 0; 258 238 } 259 239 -
uspace/lib/c/generic/io/klog.c
r0fa34dd r3e6a98c5 39 39 #include <unistd.h> 40 40 #include <errno.h> 41 #include <abi/klog.h>42 41 #include <io/klog.h> 43 42 #include <io/printf_core.h> … … 45 44 size_t klog_write(const void *buf, size_t size) 46 45 { 47 ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) buf, size);46 ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, size); 48 47 49 48 if (ret >= 0) … … 55 54 void klog_update(void) 56 55 { 57 (void) __SYSCALL3(SYS_KLOG, KLOG_UPDATE, (uintptr_t) NULL, 0); 58 } 59 60 void klog_command(const void *buf, size_t size) 61 { 62 (void) __SYSCALL3(SYS_KLOG, KLOG_COMMAND, (sysarg_t) buf, (sysarg_t) size); 56 (void) __SYSCALL3(SYS_KLOG, 1, (uintptr_t) NULL, 0); 63 57 } 64 58 -
uspace/lib/c/include/io/klog.h
r0fa34dd r3e6a98c5 42 42 extern size_t klog_write(const void *, size_t); 43 43 extern void klog_update(void); 44 extern void klog_command(const void *, size_t);45 44 extern int klog_printf(const char *, ...) 46 45 PRINTF_ATTRIBUTE(1, 2); -
uspace/lib/c/include/stdio.h
r0fa34dd r3e6a98c5 40 40 #include <str.h> 41 41 #include <io/verify.h> 42 #include <abi/klog.h>43 42 44 43 #define EOF (-1) … … 52 51 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ 53 52 if (_n > 0) \ 54 (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \53 (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \ 55 54 } 56 55
Note:
See TracChangeset
for help on using the changeset viewer.