MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm86_initialize_pae

Function vm86_initialize_pae

freebsd/i386/i386/vm86.c:422–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420 "struct vm86_layout_nopae exceeds space allocated in locore.s");
421
422static void
423vm86_initialize_pae(void)
424{
425 int i;
426 u_int *addr;
427 struct vm86_layout_pae *vml;
428 struct pcb *pcb;
429 struct pcb_ext *ext;
430 struct soft_segment_descriptor ssd = {
431 0, /* segment base address (overwritten) */
432 0, /* length (overwritten) */
433 SDT_SYS386TSS, /* segment type */
434 0, /* priority level */
435 1, /* descriptor present */
436 0, 0,
437 0, /* default 16 size */
438 0 /* granularity */
439 };
440
441 /*
442 * Below is the memory layout that we use for the vm86 region.
443 *
444 * +--------+
445 * | |
446 * | |
447 * | page 0 |
448 * | | +--------+
449 * | | | stack |
450 * +--------+ +--------+ <--------- vm86paddr
451 * | | |Page Tbl| 1M + 64K = 272 entries = 1088 bytes
452 * | | +--------+
453 * | | | PCB | size: ~240 bytes
454 * | page 1 | |PCB Ext | size: ~140 bytes (includes TSS)
455 * | | +--------+
456 * | | |int map |
457 * | | +--------+
458 * +--------+ | |
459 * | page 2 | | I/O |
460 * +--------+ | bitmap |
461 * | page 3 | | |
462 * | | +--------+
463 * +--------+
464 */
465
466 /*
467 * A rudimentary PCB must be installed, in order to get to the
468 * PCB extension area. We use the PCB area as a scratchpad for
469 * data storage, the layout of which is shown below.
470 *
471 * pcb_esi = new PTD entry 0
472 * pcb_ebp = pointer to frame on vm86 stack
473 * pcb_esp = stack frame pointer at time of switch
474 * pcb_ebx = va of vm86 page table
475 * pcb_eip = argument pointer to initial call
476 * pcb_vm86[0] = saved TSS descriptor, word 0
477 * pcb_vm86[1] = saved TSS descriptor, word 1
478 */
479#define new_ptd pcb_esi

Callers 1

vm86_initializeFunction · 0.85

Calls 5

mtx_initFunction · 0.85
bzeroFunction · 0.85
ssdtosdFunction · 0.85
msgbufinitFunction · 0.85
rcr4Function · 0.50

Tested by

no test coverage detected