arch/x86/realmode/rm/wakemain.c

Source file repositories/reference/linux-study-clean/arch/x86/realmode/rm/wakemain.c

File Facts

System
Linux kernel
Corpus path
arch/x86/realmode/rm/wakemain.c
Extension
.c
Size
1631 bytes
Lines
88
Domain
Architecture Layer
Bucket
arch/x86
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (s) {
		case '.':
			beep(DOT_HZ);
			udelay(US_PER_DOT);
			beep(0);
			udelay(US_PER_DOT);
			break;
		case '-':
			beep(DASH_HZ);
			udelay(US_PER_DOT * 3);
			beep(0);
			udelay(US_PER_DOT);
			break;
		default:	/* Assume it's a space */
			udelay(US_PER_DOT * 3);
			break;
		}
	}
}

struct port_io_ops pio_ops;

void main(void)
{
	init_default_io_ops();

	/* Kill machine if structures are wrong */
	if (wakeup_header.real_magic != 0x12345678)
		while (1)
			;

	if (wakeup_header.realmode_flags & 4)
		send_morse("...-");

	if (wakeup_header.realmode_flags & 1)
		asm volatile("lcallw   $0xc000,$3");

	if (wakeup_header.realmode_flags & 2) {
		/* Need to call BIOS */
		probe_cards(0);
		set_mode(wakeup_header.video_mode);
	}
}

Annotation

Implementation Notes