]> Git Repo - qemu.git/blob - tests/migration/x86-a-b-bootblock.s
ide: fix invalid TRIM range abortion for macio
[qemu.git] / tests / migration / x86-a-b-bootblock.s
1 # x86 bootblock used in migration test
2 #  repeatedly increments the first byte of each page in a 100MB
3 #  range.
4 #  Outputs an initial 'A' on serial followed by repeated 'B's
5 #
6 # run   tests/migration/rebuild-x86-bootblock.sh
7 #   to regenerate the hex, and remember to include both the .h and .s
8 #   in any patches.
9 #
10 # Copyright (c) 2016 Red Hat, Inc. and/or its affiliates
11 # This work is licensed under the terms of the GNU GPL, version 2 or later.
12 # See the COPYING file in the top-level directory.
13 #
14 # Author: [email protected]
15
16
17 .code16
18 .org 0x7c00
19         .file   "fill.s"
20         .text
21         .globl  start
22         .type   start, @function
23 start:             # at 0x7c00 ?
24         cli
25         lgdt gdtdesc
26         mov $1,%eax
27         mov %eax,%cr0  # Protected mode enable
28         data32 ljmp $8,$0x7c20
29
30 .org 0x7c20
31 .code32
32         # A20 enable - not sure I actually need this
33         inb $0x92,%al
34         or  $2,%al
35         outb %al, $0x92
36
37         # set up DS for the whole of RAM (needed on KVM)
38         mov $16,%eax
39         mov %eax,%ds
40
41         mov $65,%ax
42         mov $0x3f8,%dx
43         outb %al,%dx
44
45         # bl keeps a counter so we limit the output speed
46         mov $0, %bl
47 mainloop:
48         # Start from 1MB
49         mov $(1024*1024),%eax
50 innerloop:
51         incb (%eax)
52         add $4096,%eax
53         cmp $(100*1024*1024),%eax
54         jl innerloop
55
56         inc %bl
57         jnz mainloop
58
59         mov $66,%ax
60         mov $0x3f8,%dx
61         outb %al,%dx
62
63         jmp mainloop
64
65         # GDT magic from old (GPLv2)  Grub startup.S
66         .p2align        2       /* force 4-byte alignment */
67 gdt:
68         .word   0, 0
69         .byte   0, 0, 0, 0
70
71         /* -- code segment --
72          * base = 0x00000000, limit = 0xFFFFF (4 KiB Granularity), present
73          * type = 32bit code execute/read, DPL = 0
74          */
75         .word   0xFFFF, 0
76         .byte   0, 0x9A, 0xCF, 0
77
78         /* -- data segment --
79          * base = 0x00000000, limit 0xFFFFF (4 KiB Granularity), present
80          * type = 32 bit data read/write, DPL = 0
81          */
82         .word   0xFFFF, 0
83         .byte   0, 0x92, 0xCF, 0
84
85 gdtdesc:
86         .word   0x27                    /* limit */
87         .long   gdt                     /* addr */
88
89 /* I'm a bootable disk */
90 .org 0x7dfe
91         .byte 0x55
92         .byte 0xAA
This page took 0.028987 seconds and 4 git commands to generate.