réplica de
https://github.com/Arnau478/quark.git
synced 2024-05-19 20:36:31 +02:00
Arnau Camprubí
be55b8121c
- Implemented basic FDC capable of reading floppy disc sectors - Now PIT timer can be used, as it counts the ticks - Now the keyboard is buffered, instead of being accessed only during the interrupt itself - HAL for sleep() - gets() - atoi() - Now shell is not called by the IRQ, but it's a procedure that reads the key buffer
31 líneas
515 B
C
31 líneas
515 B
C
#include "string.h"
|
|
|
|
int strlen(char *s){
|
|
int len = 0;
|
|
while(*(s++)) len++;
|
|
return len;
|
|
}
|
|
|
|
int strcmp(char *s1, char *s2){
|
|
while(*s1 && (*s1 == *s2)) {s1++; s2++;}
|
|
return *(const unsigned char *)s1 - *(const unsigned char *)s2;
|
|
}
|
|
|
|
void strcpy(char *dest, char *src){
|
|
while(*src){
|
|
*(dest++) = *(src++);
|
|
}
|
|
*dest = '\0';
|
|
}
|
|
|
|
int atoi(char *str){
|
|
int res = 0;
|
|
|
|
for(int i = 0; i < strlen(str); i++){
|
|
res *= 10;
|
|
res += str[i] - '0';
|
|
}
|
|
|
|
return res;
|
|
}
|