Мы поможем в написании ваших работ!



ЗНАЕТЕ ЛИ ВЫ?

Accomplishing 1/0 Protection in NT

Поиск

То figure out how to grant 1/0 ассеss to а user mode арр, уои have to understand how 1/0 protection is imple­mented in Windows NT. NT doesn't actually implement the

­ 1/O protection оn its own. Since the СРИ саn trap at­ tempted 1/0 port ассеss, NT depends оп this feature. The first mechanism that must bе understood is the privi­lege­ level system used bу the 80х86 processors. Four privileged levels are defined Ьу the processor ­ О, 1,

2, and 3 ­ and the СРИ a1ways operates at оnе of these levels. The most privileged level is О; the least privi­leged, 3. NT uses only levels О.and 3. privilege level О is used for the fиll­access kernel mode and 3 for the more restrictive user mode. The current privilege level

(CPL) of the processor is stored in the two least­ significant bits of the CS (code segment) register. Rather than statically defining which privilege lev­els саn have 1/0 ассеss, the СРИ defines аn 1/0 privi­lege level (10PL) value, which is compared against the CPL to determine if 1/0 instructions сап bе used freely. The 10PL is stored in two bits, of the processor' s EFLAGS register. Аny process with а CPL that is numerically greater than the 10PL must go through the 1/0 protection mechanism when attempting port 1/0 ассеss.

Весаusе the 10PL cannot Ье less than О, programs running at privilege 1evel ­ (like kernel­mode device drivers) will always have direct port 1/0 ассеss., NT sets the

10PL to О. Usеr­mоdе code always has а CPL of 3, which is larger than the 10PJ;.. Therefore, user­mode port 1/0 ассеss attempts must go through the protection mecha­nism. Determining if CPL>10PL is the first step in the protection mechanism. 1/0 protection is not all­or­noth­ing. The processor иses а flexible mechanism that allows the operating system to grant direct ассеss to апу зиЬ­ set of 1/0 ports оп а task­by­task basis.

The СРИ accomplishes this bу using а bitmask array, where each bit corresponds to аn 1/0 port. 1f the bit is а 1, ассеss is disallowed and ап exception occurs when­ ever ассеss to the corresponding port is attempted. 1f the bit is а О, direct and unhampered ассеss is granted

to that particular port. The 1/0 address sрасе of the 80х86 processors encompasses 65, 536 8­bi t ports. The bitmask array is 8192 (Ох2000) bytes long, since the bitmask array is packed зо that each byte holds eight bits of the array. There is even flexibility in how much

of the bitmask array must Ье provided. Уои сап provide anywhere from О to the fиll 8192 bytes of the table. The table always starts from 1/0 address О, bиt уои саn choose not to provide the bitmask for upper 1/0 address­es. Апу part of the bitmask that уои don’t provide is assumed to bе 1, and therefore, access is not granted to those ports.

The bitmask array, called the 1/0 Permission bit Мар (10PM), is stored in the Task State Segment (TSS) structure in main memory, which is contained in а special, segment referenced bу the segment selector in the proc­essor's Task Register (TR). The location of the 10PM within the TSS is flexible. The offset of the 10PM within the TSS is stored in а 2­byte integer at location Ох66 in the TSS.

­

 

 

C++. Существительные с прилагательными

 

INTRODUCTION

This manual describes the C++ programming language. Where implementation-dependent details exist it tries to point them out. With few exceptions, such dependencies follow directly from the properties of the hardware. They are summarized in #2.6, C++ is "old C" as described in the С book extended with classes, inline functions, operator overloading, function name overloading, constant types, references, free store management, function argument check­ing, and a new function declaration syntax. The differ­ences between C++ and "old C" are summarized in #19.

Слова и словосочетания к тексту

to describe – описывать

to implement – выполнять, осуществлять

to exist – существовать, находиться, быть

exception – исключение

 

С++. Прилагательные

 

 

Constants

There are several kinds of constants, as listed below. Hardware characteristics that affects sizes are sum­marized in #2.6.

Integer constants

An integer constant consisting of a sequence of digits is taken to be octal if it begins with 0 (digit zero), decimal otherwise. The digits 8 and 9 are not octal digits. A sequence of digits preceded by Ox or OX (digit zero) is taken to be a hexadecimal. Hexadecimal digits include a or A through f or F with values 10 through 15. A decimal constant whose value exceeds the largest signed machine integer is taken to be long; an octal or hex constants are taken to be int.

Explicit long constants

A decimal, octal, or hexadecimal integer constant im­mediately followed by 1 (letter ell) or L is a long constant.

Character constants

A character constant is a character enclosed in sin­gle quotes, as in '. The value of a character con­stant is numerical value of the character in the ma­chine's character set. Character constants are taken to be int.

Certain non-graphic characters, the single quote \ and the backslash \, may be represented according to the following table of escape sequences:

new-line NL(LF) \n

horizontal tab NT \t

vertical tab VT \v

backspace BS \b

carriage return CR \r

form feed FF \f

backslash \ \\

single quote “ \\

bit pattern ddd \ddd

The escape \ddd consists of the backslash followed by 1, 2 or 3 octal digits which are taken to specify the value of the desired character. A special case of this construction is \0 (not followed by a digit), which indicates the character NULL. If the character following a backslash is not one of those specified, the backslash is ignored.

Floating constants

A floating constant consists of an integer part, a decimal point, a fraction part, an e or E, and an optionally signed integer exponent. The integer and fraction parts both consist of a sequence of digits. Either the integer part or the fraction part (not both) may be missing; either the decimal point or the e (E) and the exponent (not both) may be missing. A floating constant which cannot be represented exactly as a single-precision float is taken to be double precision; see #2.6.

Enumeration constants

Names declared as enumerators (see #8.5) are constants of type int.

Declared constants

An object (#5) of any type can be specified to have a constant value throughout the scope (#4.1) of its name. For pointers the *const declarator (#8.3) is used to achieve this; for non-pointer objects the specifier const (#8.2) is used.

Упражнение 16. Try to explain now what is an integer const, an explicit const, a character tonst, a floating const, a declared const. Попробуйте сказать по-английски, что такое целочисленная константа, эксплицитная константа, символьная константа с плавающей запятой, объявленная константа. Для этого сократите каждую часть текста до предложения используя схему: constant is a constant (a character, a sequence, an object...)

Упражнение 1 7. для тренировки быстрого чтения.

Look through the table and comment on it using the degree of comparison of the words. Просмотрите таблицу и прокомментируйте ее, используя степени сравнения слов — many, large, little.

Text II

I

Hardware characteristics

The following table summarizes certain hardware prop­erties that vary from machine to machine.

 

  DEC VAX-11 Motorola 68000 IBM 370 ASCII ASCII EBCDIC  
char 8 bits 8 bits 8 bits
int 32 bits 16 bits 32 bits
short 16 bits 16 bits 16 bits
long 32 bits 32 bits 32 bits
float 32 bits 32 bits 32 bits
double 64 bits 64 bits 64 bits
pointer 32 bits 32 bits 24 bits
float range +10E+38 ±10E±38 ±10E±76
double range +10E+38 ±10E ±38 +10E +76
char type signed unsigned unsigned
field type signed unsigned unsigned
field order right-to- left left-to-right left-to-right

Упражнение18. Translate the dialogue:

— Какие опции компилятора я должен использовать для составления программ с применением библиотеки Object Windows?

— For OWL applications that do not use DLLs, you can use the «Windows all functions exportable», «Windows explicit functions exported», or «Win­dows smart callbacks» options in the Options | Compiler | Entry/Exit code dialog box.

— Какие установки мне нужно поместить в файл определения моего программного модуля?

—It must be admitted that you do not need to provide module defini­tion files for your Windows programs when they are built with Borland

 

 

Слова и словосочетания: Прочтите вслух и переведите однокоренные слова, используя знания суффиксов:

To affect – воздействовать, влиять

Sequence – порядок, последовательность

To take – полагать, считать, понимать

Is taken to be - _____

To exceed – превышать, превосходить

To enclose – окружать, заключать, вкладывать

Value – ценность, стоимость, оценка

Optional – необязательный, произвольный

Precision – точность

To enumerate – перечислять

Enumeration - ________

To achieve – достигать

Achievement - ____

To surround – окружать, охватывать

Array – матрица, массив

 

Упражнение 1. Поставьте прилагательные в положительную степень

 

Larger, better, earliest, redder, nearest, higher, nearer, deeper, smaller, fewer.

 

Упражнение 2. Переведите словосочетания с противоположным значением:

A bad model, a more reliable method, the nearest way, the worst variant, a least effective device, a better way, a less reliable device.

 

Упражнение 3. Заполните пропуски:

1) BASIC is (popularest, more popular) on microcomputers.

2) BASIC is one of (more easy, most easy, the easiest) programming languages.

3) The (most, main) purpose of computers is to solve complex problems.

4) What is (a good, a better, the best) way to compile a program?

5) A bit is (a small, the smallest) unit of information.

 

Упражнение 4. Выберите правильный вариант:

1) Much (fewer, less) details are necessary foe the new model.

2) Basic is a (low, high) level programming language.

3) (Higher, high) mathematics is a basic subject.

 



Поделиться:


Последнее изменение этой страницы: 2017-02-10; просмотров: 230; Нарушение авторского права страницы; Мы поможем в написании вашей работы!

infopedia.su Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Обратная связь - 18.191.171.136 (0.005 с.)