Главная » Просмотр файлов » Volume 2 System Programming

Volume 2 System Programming (794096), страница 20

Файл №794096 Volume 2 System Programming (Intel and AMD manuals) 20 страницаVolume 2 System Programming (794096) страница 202019-04-28СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 20)

Interrupts can be caused whensystem hardware signals an interrupt condition using one of the external-interrupt signals on theprocessor. Interrupts can also be caused by software that executes an interrupt instruction. Exceptionsoccur when the processor detects an abnormal condition as a result of executing an instruction. Theterm “interrupts” as used throughout this volume includes both interrupts and exceptions when thedistinction is unnecessary.System software not only sets up the interrupt handlers, but it must also create and initialize the datastructures the processor uses to execute an interrupt handler when an interrupt occurs.

The datastructures include the code-segment descriptors for the interrupt-handler software and any datasegment descriptors for data and stack accesses. Interrupt-gate descriptors must also be supplied.Interrupt gates point to interrupt-handler code-segment descriptors, and the entry point in an interrupthandler. Interrupt gates are stored in the interrupt-descriptor table. The code-segment and datasegment descriptors are stored in the global-descriptor table and, optionally, the local-descriptor table.When an interrupt occurs, the processor uses the interrupt vector to find the appropriate interrupt gatein the interrupt-descriptor table. The gate points to the interrupt-handler code segment and entry point,and the processor transfers control to that location.

Before invoking the interrupt handler, the processorsaves information required to return to the interrupted program. For details on how the processortransfers control to interrupt handlers, see “Legacy Protected-Mode Interrupt Control Transfers” onpage 229, and “Long-Mode Interrupt Control Transfers” on page 239.System-Programming Overview19AMD64 Technology24593—Rev. 3.13—July 2007Table 1-2 shows the supported interrupts and exceptions, ordered by their vector number. Refer to“Vectors” on page 206 for a complete description of each interrupt, and a description of the interruptmechanism.Table 1-2.Interrupts and ExceptionsVector0Integer Divide-by-Zero Exception1Debug Exception2Non-Maskable-Interrupt3Breakpoint Exception (INT 3)4Overflow Exception (INTO instruction)5Bound-Range Exception (BOUND instruction)6Invalid-Opcode Exception7Device-Not-Available Exception8Double-Fault Exception9Coprocessor-Segment-Overrun Exception (reserved inAMD64)10Invalid-TSS Exception11Segment-Not-Present Exception12Stack Exception13General-Protection Exception14Page-Fault Exception15(Reserved)16x87 Floating-Point Exception17Alignment-Check Exception18Machine-Check Exception19SIMD Floating-Point Exception0-255Any1.7DescriptionInterrupt InstructionsHardware Maskable InterruptsAdditional System-Programming Facilities1.7.1 Hardware MultitaskingA task is any program that the processor can execute, suspend, and later resume executing at the pointof suspension.

During the time a task is suspended, other tasks are allowed to execute. Each task has itsown execution space, consisting of a code segment, data segments, and a stack segment for eachprivilege level. Tasks can also have their own virtual-memory environment managed by the pagetranslation mechanism. The state information defining this execution space is stored in the task-statesegment (TSS) maintained for each task.20System-Programming Overview24593—Rev. 3.13—July 2007AMD64 TechnologySupport for hardware multitasking is provided by implementations of the AMD64 architecture whensoftware is running in legacy mode.

Hardware multitasking provides automated mechanisms forswitching tasks, saving the execution state of the suspended task, and restoring the execution state ofthe resumed task. When hardware multitasking is used to switch tasks, the processor takes thefollowing actions:••••The processor automatically suspends execution of the task, allowing any executing instructions tocomplete and save their results.The execution state of a task is saved in the task TSS.The execution state of a new task is loaded into the processor from its TSS.The processor begins executing the new task at the location specified in the new task TSS.Use of hardware-multitasking features is optional in legacy mode. Generally, modern operatingsystems do not use the hardware-multitasking features, and instead perform task management entirelyin software.

Long mode does not support hardware multitasking at all.Whether hardware multitasking is used or not, system software must create and initialize at least onetask-state segment data-structure. This requirement holds for both long-mode and legacy-modesoftware. The single task-state segment holds critical pieces of the task execution environment and isreferenced during certain control transfers.Detailed information on hardware multitasking is available in Chapter 12, “Task Management,” alongwith a full description of the requirements that must be met in initializing a task-state segment whenhardware multitasking is not used.1.7.2 Machine CheckImplementations of the AMD64 architecture support the machine-check exception.

This exception isuseful in system applications with stringent requirements for reliability, availability, and serviceability.The exception allows specialized system-software utilities to report hardware errors that are generallysevere and non-recoverable. Providing the capability to report such errors can allow complex systemproblems to be pinpointed rapidly.The machine-check exception is described in Chapter 9, “Machine Check Mechanism.” Much of theerror-reporting capabilities is implementation dependent.

For more information, developers ofmachine-check error-reporting software should also refer to the BIOS writer’s guide for a specificimplementation.1.7.3 Software DebuggingA software-debugging mechanism is provided in hardware to help software developers quickly isolateprogramming errors. This capability can be used to debug system software and application softwarealike. Only privileged software can access the debugging facilities. Generally, software-debug supportis provided by a privileged application program rather than by the operating system itself.The facilities supported by the AMD64 architecture allow debugging software to perform thefollowing:System-Programming Overview21AMD64 Technology••••••••24593—Rev.

3.13—July 2007Set breakpoints on specific instructions within a program.Set breakpoints on an instruction-address match.Set breakpoints on a data-address match.Set breakpoints on specific I/O-port addresses.Set breakpoints to occur on task switches when hardware multitasking is used.Single step an application instruction-by-instruction.Single step only branches and interrupts.Record a history of branches and interrupts taken by a program.The debugging facilities are fully described in “Software-Debug Resources” on page 325. Someprocessors provide additional, implementation-specific debug support.

For more information, refer tothe BIOS writer’s guide for the specific implementation.1.7.4 Performance MonitoringFor many software developers, the ability to identify and eliminate performance bottlenecks from aprogram is nearly as important as quickly isolating programming errors. Implementations of theAMD64 architecture provide hardware performance-monitoring resources that can be used by specialsoftware applications to identify such bottlenecks. Non-privileged software can access theperformance monitoring facilities, but only if privileged software grants that access.The performance-monitoring facilities allow the counting of events, or the duration of events.Performance-analysis software can use the data to calculate the frequency of certain events, or the timespent performing specific activities.

That information can be used to suggest areas for improvementand the types of optimizations that are helpful.The performance-monitoring facilities are fully described in “Performance Optimization” onpage 339. The specific events that can be monitored are generally implementation specific. For moreinformation, refer to the BIOS writer’s guide for the specific implementation.22System-Programming Overview24593—Rev.

Характеристики

Тип файла
PDF-файл
Размер
3,37 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6476
Авторов
на СтудИзбе
304
Средний доход
с одного платного файла
Обучение Подробнее