Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define L4PANDA
- #define l4util_kip_for_each_feature(s) for (s += strlen(s) + 1; *s; s += strlen(s) + 1)
- #include <stdio.h>
- #include <string.h>
- #include <l4/util/reboot.h>
- #include <l4/util/kip.h>
- #include <l4/sys/ipc.h>
- #include <l4/sys/vhw.h>
- #include <l4/util/util.h>
- #include <l4/sys/mem_op.h>
- #include <l4/sys/factory.h>
- #include <l4/re/env.h>
- #include <unistd.h>
- #include <sys/time.h>
- int main(void)
- {
- l4_kernel_info_t *kip = l4re_kip();
- struct l4_vhw_descriptor *vhw;
- char cmd[12] ;
- unsigned long readVal;
- int i;
- // L4::Factory* factory = L4Re::Env::env()->factory();
- printf("Initialization Finished\n");
- while(1)
- {
- printf("erry@erry-OS : \t");
- fgets(cmd,sizeof(cmd),stdin);
- printf("%s",cmd);
- if(strcmp(cmd,"clear\n")==0)
- {
- int n;
- for (n = 0; n < 10; n++)
- printf( "\n\n\n\n\n\n" );
- }
- if(strcmp(cmd,"reboot\n")==0)
- {
- printf("Rebooting ...\t");
- l4util_reboot();
- }
- if(strcmp(cmd,"kipinfo\n")==0)
- {
- if(!kip)
- printf("KIP not available!\n");
- vhw = l4_vhw_get(kip);
- printf("kip at %p, vhw at %p\n", kip, vhw);
- // print_entry(l4_vhw_get_entry(vhw, i));
- }
- if(strcmp(cmd,"testmem\n")==0)
- {
- readVal=l4_mem_read(0x4A31013C,L4_MEM_WIDTH_4BYTE);
- printf("Sucessful Memory Read Value: 0x%x \t",readVal);
- //l4util_reboot();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement