I'm developing a operating system and I need a test program (function of any kind) to te开发者_如何学Gost certain internal features. I cannot find any appropriate program to do this job. Probably one of you knows one. The program should be open source, written in C with very little user library usage (only file IO, pthreads, stdio, stdlib preferred) and must have a binary size of at least 2MB.
Thanks for any suggestions.
/* "Big Hello". */
/* Hereby placed in the public domain. */
#include <stdio.h>
char mem[1<<21] = { 1 };
int main(void)
{
printf( "Hello, world!\n" );
return 0;
}
Seriously though, I doubt a particular file size of the executable is really what you want. What is it you really want from a program that a plain old "Hello world" isn't complicated enough to exercise?
There are many different flavors of shells around that are open source. You should be able to chose one that uses the right functionalities from the OS to provide a good test.
The shells that are accessible in the busybox package are probably a good starting point.
精彩评论