Revision 96
fixed; TODO: restructure
lab5/graphics.c | ||
---|---|---|
14 | 14 |
int r; |
15 | 15 |
struct minix_mem_range mmr; |
16 | 16 |
mmr.mr_base = 0x0; |
17 |
mmr.mr_limit = 0xFFFF; |
|
17 |
mmr.mr_limit = 0xFFFFF;
|
|
18 | 18 |
|
19 |
//struct reg86 reg_86;
|
|
19 |
struct reg86 reg_86; |
|
20 | 20 |
|
21 | 21 |
if ((r = sys_privctl(SELF, SYS_PRIV_ADD_MEM, &mmr))) |
22 | 22 |
panic("sys_privctl (ADD MEM) failed: %d\n", r); |
... | ... | |
44 | 44 |
if (video_mem == MAP_FAILED) |
45 | 45 |
panic("Error: couldn't map video memory."); |
46 | 46 |
|
47 |
memset(®_86, 0, sizeof(reg_86)); // reset struct |
|
48 |
|
|
49 |
reg_86.intno = VC_BIOS_SERV; |
|
50 |
reg_86.ah = VBE_CALL; |
|
51 |
reg_86.al = SET_VBE_MD; |
|
52 |
reg_86.bx = mode | LINEAR_FRAME_BUFFER_MD; |
|
53 |
|
|
54 |
// BIOS CALL |
|
55 |
|
|
56 |
if (sys_int86(®_86)) { |
|
57 |
printf("%s: sys_int86 failed\n", __func__); |
|
58 |
return BIOS_CALL_ERROR; |
|
59 |
} |
|
60 |
|
|
61 |
memset(&vbe_mem_info, 0, sizeof(vbe_mode_info_t)); // clear mem_info to initialize it |
|
62 |
|
|
47 | 63 |
// lm_free(&mem_map); |
48 | 64 |
return SUCCESS; |
49 | 65 |
} |
lab5/lab5.c | ||
---|---|---|
38 | 38 |
|
39 | 39 |
set_graphics_mode(mode); |
40 | 40 |
|
41 |
tickdelay(micros_to_ticks(delay)); |
|
41 |
tickdelay(micros_to_ticks(delay*1e6));
|
|
42 | 42 |
|
43 | 43 |
vg_exit(); |
44 | 44 |
return 0; |
Also available in: Unified diff