Issue in understanding /rootfs/rtree/sbin/init and initc files
Can you please provide some insight on from where /rootfs/rtree/sbin/init and intc binary files are generated? Actually, I'm trying to add some new program in apps and those are working locally perfect but not able to figure out how to make new hdisk img to include those program.
All applications under apps/ can be built by "make" command. You can change the sources, compile and copy the final binary to rootfs folder in order to generate a new rootfs image. For instance:
# cd apps/init_c/
# make
# cp init ../../rootfs/rtree/sbin/
# cd ../../rootfs
# sudo ./gen_hddisk_img.sh
# cp hdisk.img.gz ../kernel/
# cd ../kernel
# make install
# make test
Don't forget to take a look on the makefiles. TempOS supports only applications in raw binary with 0xC0000C as start address. And the only system calls implemented so far are the write() - only to file descriptor 1, and read() - only from file descriptor 0.....
Thanks for helping though I was doing the same since last couple of days and not getting the desired output makes me question that why the binary init file built by make command in /apps/init_c is so big like 122 MB!! And the init files of /rootfs/rtree/sbin are in size of bytes? Is three anything that I'm missing here or do I have to process that big init file(122MB) or something?
Did you use the Makefile to build init_c? The final binary should be around 200 bytes! For sure 122MB is definitely wrong.... remember that we still don't have any C library ported to TempOS, so any libc function is allowed, that's why we just use a very minimal implementation for write syscall (no printf, etc)....
Actually I tried making few other programs but was not able to integrate it with the OS. Then I tried changing the Echo program (Just the string it prints : Welcome to Echo Program) and then I tried Make in echo directory. It showed following error :

After changing the ATOI function, I was able to fix the error. But then when I saw the binary file :scream:, the sizes of both the files are huge. (Please refer the following SS)

So could you please redirect where am I wrong?
Actually, The problem doesn't get over here. Due to such large init file, while following the above given steps, the compressing part took around 1.5 hours to complete. And then while running the OS, but I guess it is taking too much time to load init from the disk image, as the OS stops at Loading sbin/init/. (Please refer to the following SS)

Could you please explain why this init file has such a large size? Are there any possible solutions to this issue?