- Timestamp:
- Aug 6, 2017, 8:33:00 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r312 r323 82 82 /* -------------------------------------------------------------------------- */ 83 83 84 /* XXX XXX XXX libk */ 85 char * 86 strstr(char *s, const char *find) 87 { 88 char c, sc; 89 size_t len; 90 91 if ((c = *find++) != 0) { 92 len = strlen(find); 93 do { 94 do { 95 if ((sc = *s++) == 0) 96 return (NULL); 97 } while (sc != c); 98 } while (strncmp(s, find, len) != 0); 99 s--; 100 } 101 return s; 102 } 103 104 static void 105 dump_memmap() 84 /* 85 * Configure the features of the system depending on the multiboot info. 86 */ 87 static void multiboot_init() 106 88 { 107 89 size_t mmap_length = mb_info.mi_mmap_length; … … 398 380 x86_printf("[+] bootloader: '%s'\n", mb_loader_name); 399 381 400 dump_memmap();401 x86_printf("[+] dump finished\n");382 multiboot_init(); 383 x86_printf("[+] multiboot_init called\n"); 402 384 403 385 hal_gpt_init(firstpa); … … 473 455 } 474 456 475 static void 476 setregion(struct region_descriptor *rd, void *base, uint16_t limit) 457 static void setregion(struct region_descriptor *rd, void *base, uint16_t limit) 477 458 { 478 459 rd->rd_limit = limit; … … 482 463 /* -------------------------------------------------------------------------- */ 483 464 484 static void 485 gdt_set_memseg(struct gdt_memseg *sd, void *base, size_t limit, 465 static void gdt_set_memseg(struct gdt_memseg *sd, void *base, size_t limit, 486 466 int type, int dpl, int gran, bool_t is64) 487 467 { … … 499 479 } 500 480 501 static void 502 gdt_set_sysseg(struct gdt_sysseg *sd, void *base, size_t limit, 481 static void gdt_set_sysseg(struct gdt_sysseg *sd, void *base, size_t limit, 503 482 int type, int dpl, int gran) 504 483 { … … 565 544 } 566 545 567 static void 568 idt_set_seg(struct idt_seg *seg, void *func, int ist, int type,int dpl, int sel)546 static void idt_set_seg(struct idt_seg *seg, void *func, int ist, int type, 547 int dpl, int sel) 569 548 { 570 549 seg->gd_looffset = (uint64_t)func & 0xffff; -
trunk/kernel/libk/string.c
r288 r323 125 125 } 126 126 127 //////////////////////////////// 128 char * strstr( char * s, 129 const char * find) 130 { 131 char c, sc; 132 size_t len; 133 134 if ((c = *find++) != 0) { 135 len = strlen(find); 136 do { 137 do { 138 if ((sc = *s++) == 0) 139 return NULL; 140 } while (sc != c); 141 } while (strncmp(s, find, len) != 0); 142 s--; 143 } 144 return s; 145 } 146 127 147 ////////////////////////////// 128 148 char * strchr( const char * s, -
trunk/kernel/libk/string.h
r238 r323 103 103 104 104 /******************************************************************************************** 105 * This function locates the first occurence of the <find> string in the <s> string. 106 ******************************************************************************************** 107 * @ s : string to be analysed. 108 * @ find : searched string 109 * @ return pointer on the found string / return NULL if not found. 110 *******************************************************************************************/ 111 char * strstr( char * s, 112 const char * find); 113 114 /******************************************************************************************** 105 115 * This function locates the first occurence of the <c> character in the <s> string. 106 116 ********************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.