-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.c
65 lines (46 loc) · 1.17 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
int FLAG_TFTP = 1;
char * buff="Hello World ->\n";
int gboot_main()
{
int num;
//unsigned char buf[1024*4];
#ifdef MMU_ON
mmu_init();
#endif
uart_init();
led_init();
button_init();
init_irq();
led_off();
dma_init();
dma_start();
dm9000_init();
while(1)
{
printf("\n***************************************\n\r");
printf("\n****************MYBOOT*****************\n\r");
printf("1:Set Out a Arp Package to Get Host Ip and MAC!\n\r");
printf("2:Download Linux Kernel from TFTP Server!\n\r");
printf("3:Boot Linux from RAM!\n\r");
printf("\n Plese Select:");
scanf("%d",&num);
switch (num)
{
case 1:
arp_progress();
break;
case 2:
tftp_send_request("tftp.c");
while(FLAG_TFTP);
break;
case 3:
boot_linux();
//boot_linux_nand();
break;
default:
printf("Error: wrong selection!\n\r");
break;
}
}
return 0;
}