File: kernel-i386.S

package info (click to toggle)
grub2 2.02%2Bdfsg1-20
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 61,784 kB
  • sloc: ansic: 384,086; asm: 16,323; sh: 13,230; cpp: 1,994; makefile: 1,488; python: 1,458; sed: 423; lex: 393; yacc: 267; awk: 75; lisp: 50; perl: 31
file content (72 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#define ASM_FILE	1
#ifdef TARGET_MULTIBOOT2
#include <multiboot2.h>
#elif defined (TARGET_MULTIBOOT)
#include <multiboot.h>
#endif

	.text
	/* Align 32 bits boundary.  */
	.align	8

#ifdef TARGET_MULTIBOOT2
	/* Multiboot header.  */
multiboot_header:
	/* magic */
	.long	MULTIBOOT2_HEADER_MAGIC
	/* ISA: i386 */
	.long   MULTIBOOT_ARCHITECTURE_I386
	/* Header length.  */
	.long	multiboot_header_end - multiboot_header
	/* checksum */
	.long	-(MULTIBOOT2_HEADER_MAGIC + MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header))
	.short MULTIBOOT_HEADER_TAG_END
	.short 0
	.long 8
multiboot_header_end:
#elif defined (TARGET_MULTIBOOT)
	/* Multiboot header.  */
multiboot_header:
	/* magic */
	.long	MULTIBOOT_HEADER_MAGIC
	/* flags */
	.long	0
	/* checksum */
	.long	-MULTIBOOT_HEADER_MAGIC
#endif
	
	.global start

serialmsg:	
1:	
	movb 0(%esi), %bl
	testb %bl, %bl
	jz 1f
	movw $0x3fd, %dx
2:	
	inb %dx, %al
	testb $0x20, %al
	jz   2b

	movw $0x3f8, %dx
	movb %bl, %al
	outb %al, %dx
	incl %esi
	jmp 1b
1:
	ret

	.globl _start
_start:
	lea message, %esi
	call serialmsg

#include "qemu-shutdown-x86.S"

1:
	hlt
	jmp 1b

message:
	.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"
	.byte 0