The softscroll method is never the default the operator is supposed to select

The softscroll method is never the default the

This preview shows page 61 - 63 out of 140 pages.

The softscroll method is never the default; the operator is supposed to select it only if hardware scrolling does not work or is not desired for some reason. One reason might be a desire to use the screendump command, either to save the screen memory in a file or to view the main console display when working from a remote terminal. When hardware scrolling is in effect, screendump is likely to give unexpected results, because the start of the screen memory is likely not to coincide with the start of the visible display. On line 16226 the wrap variable is tested as the first part of a compound test. Wrap is true for older displays that can support hardware scrolling, and if the test fails, simple hardware scrolling occurs on line 16230, where the origin pointer used by the video controller chip, cons->c_org, is updated to point to the first character to be displayed at the upper-left corner of the display. If wrap is FALSE, the compound test continues with a test of whether the block to be moved up in the scroll operation overflows the bounds of the memory block designated for this console. If this is so, vid_vid_copy is called again to make a wrapped move of the block to the start of the console's allocated memory, and the origin pointer is updated. If there is no overlap, control passes to the simple hardware scrolling method always used by older video controllers. This consists of adjusting cons- >c_org and then putting the new origin in the correct register of the controller chip. The call to do this is executed later, as is a call to blank the bottom line on the screen to achieve the "scrolling" effect.
Image of page 61
[Page 361] The code for scrolling down is very similar to that for scrolling up. Finally, mem_vid_copy is called to blank out the line at the bottom (or top) addressed by new_line. Then set_6845 is called to write the new origin from cons->c_org into the appropriate registers, and flush makes sure all changes become visible on the screen. We have mentioned flush (line 16259) several times. It transfers the characters in the queue to the video memory using mem_vid_copy, updates some variables, and then makes sure the row and column numbers are reasonable, adjusting them if, for instance, an escape sequence has tried to move the cursor to a negative column position. Finally, a calculation of where the cursor ought to be is made and is compared with cons->c_cur. If they do not agree, and if the video memory that is currently being handled belongs to the current virtual console, a call to set_6845 is made to set the correct value in the controller's cursor register. Figure 3-44 shows how escape sequence handling can be represented as a finite state machine. This is implemented by parse_escape (line 16293) which is called at the start of out_char if cons->c_esc_state is nonzero. An ESC itself is detected by out_char and makes cons->c_esc_state equal to 1. When the next character is received, parse_escape prepares for further processing by putting a "\0" in cons->c_esc_intro, a pointer to the
Image of page 62
Image of page 63

You've reached the end of your free preview.

Want to read all 140 pages?

  • One '20

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors