Rev 205 | Rev 452 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 205 | Rev 413 | ||
---|---|---|---|
Line 78... | Line 78... | ||
78 | ega_cursor = ega_cursor - ROW; |
78 | ega_cursor = ega_cursor - ROW; |
79 | } |
79 | } |
80 | 80 | ||
81 | void ega_putchar(const char ch) |
81 | void ega_putchar(const char ch) |
82 | { |
82 | { |
83 | pri_t pri; |
83 | ipl_t ipl; |
84 | 84 | ||
85 | pri = cpu_priority_high(); |
85 | ipl = interrupts_disable(); |
86 | spinlock_lock(&egalock); |
86 | spinlock_lock(&egalock); |
87 | 87 | ||
88 | switch (ch) { |
88 | switch (ch) { |
89 | case '\n': |
89 | case '\n': |
90 | ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW; |
90 | ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW; |
Line 99... | Line 99... | ||
99 | } |
99 | } |
100 | ega_check_cursor(); |
100 | ega_check_cursor(); |
101 | ega_move_cursor(); |
101 | ega_move_cursor(); |
102 | 102 | ||
103 | spinlock_unlock(&egalock); |
103 | spinlock_unlock(&egalock); |
104 | cpu_priority_restore(pri); |
104 | interrupts_restore(ipl); |
105 | } |
105 | } |
106 | 106 | ||
107 | void ega_move_cursor(void) |
107 | void ega_move_cursor(void) |
108 | { |
108 | { |
109 | outb(0x3d4,0xe); |
109 | outb(0x3d4,0xe); |