开发者

Open source C program with little requirements and at least 2MB binary size

开发者 https://www.devze.com 2023-01-31 11:06 出处:网络
I\'m developing a operating system and I need a test program (function of any kind) to te开发者_如何学Gost certain internal features.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消