Add memcmp(), clean up bochsrc.txt
This commit is contained in:
@@ -60,3 +60,16 @@ usize_t strlen(const char *str) {
|
|||||||
for (s = str; *s; ++s);
|
for (s = str; *s; ++s);
|
||||||
return (s - str);
|
return (s - str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int memcmp(const void *s1, const void *s2, usize_t n) {
|
||||||
|
unsigned char *p = (unsigned char *)s1;
|
||||||
|
unsigned char *q = (unsigned char *)s2;
|
||||||
|
|
||||||
|
while (n--) {
|
||||||
|
if (*p != *q) {
|
||||||
|
return (int)*p - (int)*q;
|
||||||
|
}
|
||||||
|
p++, q++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
usize_t memset(void *dst, byte_t b, usize_t n);
|
usize_t memset(void *dst, byte_t b, usize_t n);
|
||||||
usize_t memcpy(void *dst, const void *src, usize_t n);
|
usize_t memcpy(void *dst, const void *src, usize_t n);
|
||||||
|
int memcmp(const void *s1, const void *s2, usize_t n);
|
||||||
|
|
||||||
void strncpy(char* dst, const char* src, usize_t n);
|
void strncpy(char* dst, const char* src, usize_t n);
|
||||||
usize_t strlen(const char *str);
|
usize_t strlen(const char *str);
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
# machine
|
# machine
|
||||||
megs: 64
|
megs: 64
|
||||||
cpu: model=pentium
|
cpu: model=pentium
|
||||||
|
|
||||||
# roms
|
# roms
|
||||||
romimage: file=/usr/share/bochs/BIOS-bochs-latest, options=fastboot
|
romimage: file=/usr/share/bochs/BIOS-bochs-latest, options=fastboot
|
||||||
vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest.bin
|
vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest.bin
|
||||||
|
|
||||||
# device config
|
# device config
|
||||||
ata0: enabled=1
|
ata0: enabled=1
|
||||||
ata0-master: type=cdrom, path=out/i386_pc/mop3.iso, status=inserted
|
ata0-master: type=cdrom, path=out/i386_pc/mop3.iso, status=inserted
|
||||||
com1: enabled=1, mode=file, dev=bochs-com1.log
|
com1: enabled=1, mode=file, dev=bochs-com1.log
|
||||||
|
|
||||||
# clock
|
# clock
|
||||||
clock: sync=realtime
|
clock: sync=realtime
|
||||||
|
|
||||||
# boot device
|
# boot device
|
||||||
boot: cdrom
|
boot: cdrom
|
||||||
|
|
||||||
# logging
|
# logging
|
||||||
error: action=report
|
error: action=report
|
||||||
panic: action=report
|
panic: action=report
|
||||||
info: action=report
|
info: action=report
|
||||||
debug: action=ignore
|
debug: action=ignore
|
||||||
log: bochs.log
|
log: bochs.log
|
||||||
|
|
||||||
# display
|
# display
|
||||||
display_library: x
|
display_library: x
|
||||||
|
|||||||
Reference in New Issue
Block a user