10235 uts: boot needs simple tem to support mdb

Review Request #1367 — Created Jan. 14, 2019 and submitted

tsoome
illumos-gate
10235
1366
c09d01f...
general
10235 uts: boot needs simple tem to support mdb


  • 0
  • 0
  • 6
  • 6
  • 12
Description From Last Updated
tsoome
tsoome
tsoome
tsoome
rm
  1. Looks good in general, but I have some notes before.

  2. usr/src/uts/i86pc/boot/boot_console.c (Diff revision 5)
     
     
    I've been trying to go through this and think I'm missing something. I see that we often set btem_params[] to have more values; however, I only see us consuming btem_params[0].
    1. Yes, I did kept the original size for array, but we only do implement the minimal set of terminal functions for mdb, as mdb is the only consumer for now. Depending on if we might decide to expand the features in the future, we will have the base functionality in place. For example, one possible feature could be to implement colors to be used with debug printouts.

  3. usr/src/uts/i86pc/boot/boot_console.c (Diff revision 5)
     
     
    Should we make it >= just in case we ever get into a state where cols is in a bad state and would cause us to go beyond fb_info.terminal.x?
  4. usr/src/uts/i86pc/boot/boot_fb.c (Diff revision 5)
     
     
     
     
     
     
    Why do we no longer need the equivalent of the \r of \b cases here?
    1. we do add the \r in bcons_putchar() and it is handled by tem.

  5. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 5)
     
     

    Name seems a little confusing, as nothing is actually set.

    1. yes, renamed to get_vga_color(). It was in boot_console.c before.

  6. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 5)
     
     
     
     
    Doesn't this conversion exist elsewhere? Do we need to duplicate it again?
    1. In this patch we did move it from boot_console.c, later, we will collect all those instances and remove duplication. We already do remove a small bit of duplication of dim_xlate and brt_xlate arrays. However, this specific array is only needed for VGA text case, to translate sun colors for vga.

  7. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 5)
     
     
    Where does the 1 << 5 come from?
    1. see the comment above:) the bit 5 is cursor disable.

  8. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 5)
     
     
    We're only going to take the lower 8 bits of color, should that actually be an int argument or should it be a uint8_t?
    1. you mean the color value itself? the vga text memory is array of 16-bit words, upper 8-bits are for foreground and background colors (4-bit values), lower 8-bits are for char to be displayed. If we do define color as uint8_t, we would need to deal with type casting for shift. I'm not sure if the uint8_t would add here enough benefit as we only set the color via translation checks anyhow.

  9. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 5)
     
     
    Should we guard against this being negative?
  10. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 5)
     
     
    Should we cast cons_color to a uint8_t explicitly? Should c be cast to a uint16_t to indicate that we're only taking the lower bits?
    1. VGA_SCREEN is defined as 16-bit unsigned int array and the compiler will do the trunkation. But of course it does not hurt to have the cast as an reminder there - except it does add noise. I did add comment instead:)

  11. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 5)
     
     
     
     
     
     
    Why don't we consider both the rows and columns cases separately? Can't both end up being true?
    1. Well, if we are not at the end of the line, then displaying one char will advance us by one column, no rows are advanced. If we are at the end of the line, then we output at the start of the next row. The only case when we could advance both column and row, is when we are at the end of the last row; but then we scroll the screen up and stay at the beginning of the last row.

  12. 
      
tsoome
tsoome
domag02
  1. Typos.
  2. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 7)
     
     

    's/unsignned/unsigned/'

  3. usr/src/uts/i86pc/boot/boot_vga.c (Diff revision 7)
     
     

    's/trunkation/truncation/'

  4. 
      
tsoome
domag02
  1. 
      
  2. usr/src/uts/i86pc/boot/boot_console.c (Diff revision 7)
     
     

    Is it possible to use the standard function isdigit() here?

        if (isdigit(c)) {
    
    1. We actually can, thanks.

  3. 
      
tsoome
rm
  1. Ship It!
  2. 
      
tsoome
tsoome
citrus
  1. Ship It!
  2. 
      
rm
  1. 
      
  2. usr/src/uts/i86pc/boot/boot_fb.c (Diff revisions 9 - 11)
     
     
    I assume this change was because we may need to change the way the screen foreground/background in addition to just a normal clearing of the line? That's why we fill the destination and no longer need to call boot_fb_eraseline_impl()?
    1. Well, the clear screen in case of FB console means we need to fill the area with BG color - this FB memory does only have color values. So the eraseline also did fill with bg color.

      However, I did create eraseline to deal with terminal lines - that means, it does not touch the "frame" area. But if we had boot loader with different kind of font, we also have different frames on screen and using eraseline means we will have garbage left over.

    2. OK, that makes sense. Thanks for clarifying.

  3. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...