kernel/source/loader/program.cpp
// note: we put it here cos for now elfs (elves?) are the only thing we support
we put it here cos for now elfs (elves?) are the only thing we support
we put it here cos for now elfs ( elves? ) are the only thing we support
bool loadIndeterminateBinary(scheduler::Process* proc, void* buf, size_t len, addr_t* entry)
	{
		assert(buf);
		assert(proc);
		assert(len > 0);
		{
			auto tmp = (char*) buf;
			if(tmp[0] == ELFMAG0 && tmp[1] == ELFMAG1 && tmp[2] == ELFMAG2 && tmp[3] == ELFMAG3)
			{
				auto ret = loadELFBinary(proc, buf, len, entry);
				syms::readSymbolsFromELF(buf, len, proc);
				return ret;
			}
		}
		error("loader", "unable to determine executable format; loading failed");
		return false;
	}
bool loadIndeterminateBinary ( scheduler :: Process * proc , void * buf , size_t len , addr_t * entry ) { assert ( buf ) ; assert ( proc ) ; assert ( len > 0 ) ; { auto tmp = ( char * ) buf ; if ( tmp [ 0 ] == ELFMAG0 && tmp [ 1 ] == ELFMAG1 && tmp [ 2 ] == ELFMAG2 && tmp [ 3 ] == ELFMAG3 ) { auto ret = loadELFBinary ( proc , buf , len , entry ) ; syms :: readSymbolsFromELF ( buf , len , proc ) ; return ret ; } } error ( " " , " " ) ; return false ; }
note: we put it here cos for now elfs (elves?)
note : we put it here cos for now elfs ( elves? )
// check for ELF // oopss.