source: soft/giet_vm/display/main.c @ 234

Last change on this file since 234 was 218, checked in by alain, 12 years ago

Introducing support for Network controller

File size: 1.5 KB
Line 
1#include <stdio.h>
2
3#define NBLOCS 32
4
5__attribute__((constructor)) int main(void)
6{
7    unsigned char buf[128*128];
8    unsigned int  x;
9    unsigned int  base = 0;
10
11    while (base < 10 * NBLOCS)
12    {
13        giet_tty_printf("\n *** image %d *** at date = %d \n",
14                base / NBLOCS, giet_proctime());
15
16        /* Phase 1 : lecture image sur le disque et transfert vers buf */
17        x = giet_ioc_read(base, buf, NBLOCS);
18        if ( x )
19        {
20            giet_tty_printf("echec giet_ioc_read %d at date : %d\n", x , giet_proctime() );
21            giet_exit();
22        }
23        x = giet_ioc_completed();
24        if ( x )
25        {
26            giet_tty_printf("echec giet_ioc_completed %d at date : %d\n", x, giet_proctime() );
27            giet_exit();
28        }
29        giet_tty_printf("ioc_read  completed at date = %d \n", giet_proctime());
30
31        // Phase 2 : transfert de buf vers le frame buffer par dma
32        x = giet_fb_write(0, buf, 128 * 128);
33        if ( x )
34        {
35            giet_tty_printf("echec giet_fb_write %d at date : %d\n", x, giet_proctime() );
36            giet_exit();
37        }
38
39        giet_tty_printf("fb_write ok at date : %d\n", giet_proctime() );
40
41        x = giet_fb_completed();
42        if ( x )
43        {
44            giet_tty_printf("echec giet_fb_completed %d at date : %d\n", x, giet_proctime() );
45            giet_exit();
46        }
47        giet_tty_printf("display completed at date = %d \n", giet_proctime());
48
49        base = base + NBLOCS;
50    }
51
52    giet_exit();
53
54    return 0;
55}
Note: See TracBrowser for help on using the repository browser.