Rev 4055 | Rev 4201 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4055 | Rev 4156 | ||
|---|---|---|---|
| Line 281... | Line 281... | ||
| 281 | /** Print character to screen |
281 | /** Print character to screen |
| 282 | * |
282 | * |
| 283 | * Emulate basic terminal commands. |
283 | * Emulate basic terminal commands. |
| 284 | * |
284 | * |
| 285 | */ |
285 | */ |
| 286 | static void fb_putchar(chardev_t *dev, char ch, bool silent) |
286 | static void fb_putchar(outdev_t *dev, char ch, bool silent) |
| 287 | { |
287 | { |
| 288 | spinlock_lock(&fb_lock); |
288 | spinlock_lock(&fb_lock); |
| 289 | 289 | ||
| 290 | switch (ch) { |
290 | switch (ch) { |
| 291 | case '\n': |
291 | case '\n': |
| Line 324... | Line 324... | ||
| 324 | cursor_put(silent); |
324 | cursor_put(silent); |
| 325 | 325 | ||
| 326 | spinlock_unlock(&fb_lock); |
326 | spinlock_unlock(&fb_lock); |
| 327 | } |
327 | } |
| 328 | 328 | ||
| 329 | static chardev_t framebuffer; |
329 | static outdev_t fb_console; |
| 330 | static chardev_operations_t fb_ops = { |
330 | static outdev_operations_t fb_ops = { |
| 331 | .write = fb_putchar, |
331 | .write = fb_putchar |
| 332 | }; |
332 | }; |
| 333 | 333 | ||
| 334 | 334 | ||
| 335 | /** Render glyphs |
335 | /** Render glyphs |
| 336 | * |
336 | * |
| Line 421... | Line 421... | ||
| 421 | memcpy(&fb_addr[FB_POS(0, y)], bgscan, bgscanbytes); |
421 | memcpy(&fb_addr[FB_POS(0, y)], bgscan, bgscanbytes); |
| 422 | } |
422 | } |
| 423 | } |
423 | } |
| 424 | 424 | ||
| 425 | 425 | ||
| 426 | /** Initialize framebuffer as a chardev output device |
426 | /** Initialize framebuffer as a output character device |
| 427 | * |
427 | * |
| 428 | * @param addr Physical address of the framebuffer |
428 | * @param addr Physical address of the framebuffer |
| 429 | * @param x Screen width in pixels |
429 | * @param x Screen width in pixels |
| 430 | * @param y Screen height in pixels |
430 | * @param y Screen height in pixels |
| 431 | * @param scan Bytes per one scanline |
431 | * @param scan Bytes per one scanline |
| Line 524... | Line 524... | ||
| 524 | sysinfo_set_item_val("fb.visual", NULL, props->visual); |
524 | sysinfo_set_item_val("fb.visual", NULL, props->visual); |
| 525 | sysinfo_set_item_val("fb.address.physical", NULL, props->addr); |
525 | sysinfo_set_item_val("fb.address.physical", NULL, props->addr); |
| 526 | 526 | ||
| 527 | fb_redraw(); |
527 | fb_redraw(); |
| 528 | 528 | ||
| 529 | chardev_initialize("fb", &framebuffer, &fb_ops); |
529 | outdev_initialize("fb", &fb_console, &fb_ops); |
| 530 | stdout = &framebuffer; |
530 | stdout = &fb_console; |
| 531 | } |
531 | } |
| 532 | 532 | ||
| 533 | /** @} |
533 | /** @} |
| 534 | */ |
534 | */ |