Xv6 with picoc & Linkage editor
v1.0
The project delineate mutual cohesion between c library, linkage editor ( linker), interpreter and operating system by porting the same on xv6 kernel
|
00001 #include <stdio.h> 00002 #include <string.h> 00003 00004 char a[10]; 00005 00006 strcpy(a, "hello"); 00007 printf("%s\n", a); 00008 00009 strncpy(a, "gosh", 2); 00010 printf("%s\n", a); 00011 00012 printf("%d\n", strcmp(a, "apple") > 0); 00013 printf("%d\n", strcmp(a, "goere") > 0); 00014 printf("%d\n", strcmp(a, "zebra") < 0); 00015 00016 printf("%d\n", strlen(a)); 00017 00018 strcat(a, "!"); 00019 printf("%s\n", a); 00020 00021 printf("%d\n", strncmp(a, "apple", 2) > 0); 00022 printf("%d\n", strncmp(a, "goere", 2) == 0); 00023 printf("%d\n", strncmp(a, "goerg", 2) == 0); 00024 printf("%d\n", strncmp(a, "zebra", 2) < 0); 00025 00026 printf("%s\n", index(a, 'o')); 00027 printf("%s\n", rindex(a, 'l')); 00028 printf("%d\n", rindex(a, 'x') == NULL); 00029 00030 memset(&a[1], 'r', 4); 00031 printf("%s\n", a); 00032 00033 memcpy(&a[2], a, 2); 00034 printf("%s\n", a); 00035 00036 printf("%d\n", memcmp(a, "apple", 4) > 0); 00037 printf("%d\n", memcmp(a, "grgr", 4) == 0); 00038 printf("%d\n", memcmp(a, "zebra", 4) < 0); 00039 00040 00041 void main() {}