"WARNING: HLT instruction with IF=0!" in bochs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

"WARNING: HLT instruction with IF=0!" in bochs

Post by heat »

Hello guys,

i ran into trouble while building my OS.I am now trying to run the meaty skeleton tutorial before expanding my kernel/OS, after taking a break in OS development.The code is slightly modified but it isn't majorly modified or something.

After i compiled ,linked the code and used grub-mkrecue to create a iso, i tested it in bochs.
When i ran it the OS halted and didn't ran any more of the code.
I looked to the log file and it said this:

Code: Select all

00019094455i[BIOS  ] Booting from 07c0:0000
00090271490i[CPU0  ] WARNING: HLT instruction with IF=0!
04030956000p[WINGUI] >>PANIC<< POWER button turned off.
04030956000i[CPU0  ] CPU is in protected mode (halted)
So i imagine the OS halted,but why did it do that?I have no hlt instruction in the middle of the code.
I need help to solve this issue, i tried the solutions i saw when i googled the error message but none of them worked. :(

boot.S src code:

Code: Select all

# Declare constants used for creating a multiboot header.
.set ALIGN,    1<<0             # align loaded modules on page boundaries
.set MEMINFO,  1<<1             # provide memory map
.set FLAGS,    ALIGN | MEMINFO  # this is the Multiboot 'flag' field
.set MAGIC,    0x1BADB002       # 'magic number' lets bootloader find the header
.set CHECKSUM, -(MAGIC + FLAGS) # checksum of above, to prove we are multiboot

# Declare a header as in the Multiboot Standard.
.section .multiboot
.align 4
.long MAGIC
.long FLAGS
.long CHECKSUM

# Reserve a stack for the initial thread.
.section .bootstrap_stack, "aw", @nobits
stack_bottom:
.skip 16384 # 16 KiB
stack_top:

# The kernel entry point.
.section .text
.global _start
.type _start, @function
_start:
	movl $stack_top, %esp
    
	
	# Initialize the core kernel before running the global constructors.
	call kernel_early

	# Call the global constructors.
	call _init

	# Transfer control to the main kernel.
	call kernel_main

	# Hang if kernel_main unexpectedly returns.
	cli
.Lhang:
	hlt
	jmp .Lhang
.size _start, . - _start
Bochs log file:

Code: Select all

00000000000i[      ] Bochs x86 Emulator 2.6.8
00000000000i[      ]   Built from SVN snapshot on May 3, 2015
00000000000i[      ] Compiled on May  3 2015 at 10:02:21
00000000000i[      ] System configuration
00000000000i[      ]   processors: 1 (cores=1, HT threads=1)
00000000000i[      ]   A20 line support: yes
00000000000i[      ] IPS is set to 4000000
00000000000i[      ] CPU configuration
00000000000i[      ]   SMP support: no
00000000000i[      ]   level: 6
00000000000i[      ]   APIC support: xapic
00000000000i[      ]   FPU support: yes
00000000000i[      ]   MMX support: yes
00000000000i[      ]   3dnow! support: no
00000000000i[      ]   SEP support: yes
00000000000i[      ]   SIMD support: sse2
00000000000i[      ]   XSAVE support: no 
00000000000i[      ]   AES support: no
00000000000i[      ]   SHA support: no
00000000000i[      ]   MOVBE support: no
00000000000i[      ]   ADX support: no
00000000000i[      ]   x86-64 support: yes
00000000000i[      ]   1G paging support: no
00000000000i[      ]   MWAIT support: yes
00000000000i[      ]   VMX support: 1
00000000000i[      ] Optimization configuration
00000000000i[      ]   RepeatSpeedups support: yes
00000000000i[      ]   Fast function calls: yes
00000000000i[      ]   Handlers Chaining speedups: yes
00000000000i[      ] Devices configuration
00000000000i[      ]   NE2000 support: yes
00000000000i[      ]   PCI support: yes, enabled=yes
00000000000i[      ]   SB16 support: yes
00000000000i[      ]   USB support: yes
00000000000i[      ]   VGA extension support: vbe cirrus voodoo
00000000000i[MEM0  ] allocated memory at 07ABA020. after alignment, vector=07ABB000
00000000000i[MEM0  ] 32,00MB
00000000000i[MEM0  ] mem block size = 0x00100000, blocks=32
00000000000i[MEM0  ] rom at 0xfffe0000/131072 ('C:\Program Files (x86)\Bochs-2.6.8/BIOS-bochs-latest')
00000000000i[SNDLOW] Sound lowlevel module 'win' initialized
00000000000i[SNDCTL] Installed sound driver 'win' at index #0
00000000000i[PLUGIN] init_dev of 'pci' plugin device by virtual method
00000000000i[DEV   ] i440FX PMC present at device 0, function 0
00000000000i[PLUGIN] init_dev of 'pci2isa' plugin device by virtual method
00000000000i[DEV   ] PIIX3 PCI-to-ISA bridge present at device 1, function 0
00000000000i[PLUGIN] init_dev of 'cmos' plugin device by virtual method
00000000000i[CMOS  ] Using local time for initial clock
00000000000i[CMOS  ] Setting initial clock to: Sat Jul 25 23:16:03 2015 (time0=1437862563)
00000000000i[PLUGIN] init_dev of 'dma' plugin device by virtual method
00000000000i[DMA   ] channel 4 used by cascade
00000000000i[PLUGIN] init_dev of 'pic' plugin device by virtual method
00000000000i[PLUGIN] init_dev of 'pit' plugin device by virtual method
00000000000i[PLUGIN] init_dev of 'vga' plugin device by virtual method
00000000000i[MEM0  ] Register memory access handlers: 0x0000000a0000 - 0x0000000bffff
00000000000i[VGA   ] interval=200000, mode=realtime
00000000000i[MEM0  ] Register memory access handlers: 0x0000e0000000 - 0x0000e0ffffff
00000000000i[BXVGA ] VBE Bochs Display Extension Enabled
00000000000i[WINGUI] Desktop Window dimensions: 1366 x 768
00000000000i[WINGUI] Number of Mouse Buttons = 5
00000000000i[WINGUI] IME disabled
00000000000i[MEM0  ] rom at 0xc0000/41472 ('C:\Program Files (x86)\Bochs-2.6.8/VGABIOS-lgpl-latest')
00000000000i[PLUGIN] init_dev of 'floppy' plugin device by virtual method
00000000000i[DMA   ] channel 2 used by Floppy Drive
00000000000i[PLUGIN] init_dev of 'acpi' plugin device by virtual method
00000000000i[DEV   ] ACPI Controller present at device 1, function 3
00000000000i[PLUGIN] init_dev of 'ioapic' plugin device by virtual method
00000000000i[IOAPIC] initializing I/O APIC
00000000000i[MEM0  ] Register memory access handlers: 0x0000fec00000 - 0x0000fec00fff
00000000000i[IOAPIC] IOAPIC enabled (base address = 0xfec00000)
00000000000i[PLUGIN] init_dev of 'keyboard' plugin device by virtual method
00000000000i[KBD   ] will paste characters every 400 keyboard ticks
00000000000i[PLUGIN] init_dev of 'harddrv' plugin device by virtual method
00000000000i[HD    ] CD on ata0-0: 'C:\Users\Pedro\SpartanOS\SpartanOS.iso'
00000000000i[CD1   ] load cdrom with path='C:\Users\Pedro\SpartanOS\SpartanOS.iso'
00000000000i[CD1   ] Opening image file as a cd
00000000000i[HD    ] Media present in CD-ROM drive
00000000000i[HD    ] Capacity is 670 sectors (1,31 MB)
00000000000i[HD    ] Using boot sequence cdrom, none, none
00000000000i[HD    ] Floppy boot signature check is enabled
00000000000i[PLUGIN] init_dev of 'pci_ide' plugin device by virtual method
00000000000i[DEV   ] PIIX3 PCI IDE controller present at device 1, function 1
00000000000i[PLUGIN] init_dev of 'unmapped' plugin device by virtual method
00000000000i[PLUGIN] init_dev of 'biosdev' plugin device by virtual method
00000000000i[PLUGIN] init_dev of 'speaker' plugin device by virtual method
00000000000i[PCSPK ] Using lowlevel sound support for output
00000000000i[PLUGIN] init_dev of 'extfpuirq' plugin device by virtual method
00000000000i[PLUGIN] init_dev of 'parallel' plugin device by virtual method
00000000000i[PAR   ] parallel port 1 at 0x0378 irq 7
00000000000i[PLUGIN] init_dev of 'serial' plugin device by virtual method
00000000000i[SER   ] com1 at 0x03f8 irq 4 (mode: null)
00000000000i[PLUGIN] init_dev of 'gameport' plugin device by virtual method
00000000000i[PLUGIN] init_dev of 'usb_uhci' plugin device by virtual method
00000000000i[DEV   ] USB UHCI present at device 1, function 2
00000000000i[UHCI  ] USB UHCI initialized
00000000000i[PLUGIN] register state of 'pci' plugin device by virtual method
00000000000i[PLUGIN] register state of 'pci2isa' plugin device by virtual method
00000000000i[PLUGIN] register state of 'cmos' plugin device by virtual method
00000000000i[PLUGIN] register state of 'dma' plugin device by virtual method
00000000000i[PLUGIN] register state of 'pic' plugin device by virtual method
00000000000i[PLUGIN] register state of 'pit' plugin device by virtual method
00000000000i[PLUGIN] register state of 'vga' plugin device by virtual method
00000000000i[PLUGIN] register state of 'floppy' plugin device by virtual method
00000000000i[PLUGIN] register state of 'unmapped' plugin device by virtual method
00000000000i[PLUGIN] register state of 'biosdev' plugin device by virtual method
00000000000i[PLUGIN] register state of 'speaker' plugin device by virtual method
00000000000i[PLUGIN] register state of 'extfpuirq' plugin device by virtual method
00000000000i[PLUGIN] register state of 'parallel' plugin device by virtual method
00000000000i[PLUGIN] register state of 'serial' plugin device by virtual method
00000000000i[PLUGIN] register state of 'gameport' plugin device by virtual method
00000000000i[PLUGIN] register state of 'usb_uhci' plugin device by virtual method
00000000000i[PLUGIN] register state of 'acpi' plugin device by virtual method
00000000000i[PLUGIN] register state of 'ioapic' plugin device by virtual method
00000000000i[PLUGIN] register state of 'keyboard' plugin device by virtual method
00000000000i[PLUGIN] register state of 'harddrv' plugin device by virtual method
00000000000i[PLUGIN] register state of 'pci_ide' plugin device by virtual method
00000000000i[SYS   ] bx_pc_system_c::Reset(HARDWARE) called
00000000000i[CPU0  ] cpu hardware reset
00000000000i[APIC0 ] allocate APIC id=0 (MMIO enabled) to 0x0000fee00000
00000000000i[CPU0  ] CPUID[0x00000000]: 00000005 756e6547 6c65746e 49656e69
00000000000i[CPU0  ] CPUID[0x00000001]: 00000633 00010800 00002028 1fcbfbff
00000000000i[CPU0  ] CPUID[0x00000002]: 00410601 00000000 00000000 00000000
00000000000i[CPU0  ] CPUID[0x00000003]: 00000000 00000000 00000000 00000000
00000000000i[CPU0  ] CPUID[0x00000004]: 00000000 00000000 00000000 00000000
00000000000i[CPU0  ] CPUID[0x00000005]: 00000040 00000040 00000003 00000020
00000000000i[PLUGIN] reset of 'pci' plugin device by virtual method
00000000000i[PLUGIN] reset of 'pci2isa' plugin device by virtual method
00000000000i[PLUGIN] reset of 'cmos' plugin device by virtual method
00000000000i[PLUGIN] reset of 'dma' plugin device by virtual method
00000000000i[PLUGIN] reset of 'pic' plugin device by virtual method
00000000000i[PLUGIN] reset of 'pit' plugin device by virtual method
00000000000i[PLUGIN] reset of 'vga' plugin device by virtual method
00000000000i[PLUGIN] reset of 'floppy' plugin device by virtual method
00000000000i[PLUGIN] reset of 'acpi' plugin device by virtual method
00000000000i[PLUGIN] reset of 'ioapic' plugin device by virtual method
00000000000i[PLUGIN] reset of 'keyboard' plugin device by virtual method
00000000000i[PLUGIN] reset of 'harddrv' plugin device by virtual method
00000000000i[PLUGIN] reset of 'pci_ide' plugin device by virtual method
00000000000i[PLUGIN] reset of 'unmapped' plugin device by virtual method
00000000000i[PLUGIN] reset of 'biosdev' plugin device by virtual method
00000000000i[PLUGIN] reset of 'speaker' plugin device by virtual method
00000000000i[PLUGIN] reset of 'extfpuirq' plugin device by virtual method
00000000000i[PLUGIN] reset of 'parallel' plugin device by virtual method
00000000000i[PLUGIN] reset of 'serial' plugin device by virtual method
00000000000i[PLUGIN] reset of 'gameport' plugin device by virtual method
00000000000i[PLUGIN] reset of 'usb_uhci' plugin device by virtual method
00000004634i[BIOS  ] $Revision: 12579 $ $Date: 2014-12-26 11:31:39 +0100 (Fr, 26. Dez 2014) $
00000318038i[KBD   ] reset-disable command received
00000320732i[BIOS  ] Starting rombios32
00000321175i[BIOS  ] Shutdown flag 0
00000321738i[BIOS  ] ram_size=0x02000000
00000322194i[BIOS  ] ram_end=32MB
00000633668i[WINGUI] dimension update x=720 y=400 fontheight=16 fontwidth=9 bpp=8
00001196354i[BIOS  ] Found 1 cpu(s)
00001210418i[BIOS  ] bios_table_addr: 0x000fa498 end=0x000fcc00
00001538001i[PCI   ] i440FX PMC write to PAM register 59 (TLB Flush)
00001866336i[P2ISA ] PCI IRQ routing: PIRQA# set to 0x0b
00001866362i[P2ISA ] PCI IRQ routing: PIRQB# set to 0x09
00001866362i[P2ISA ] PCI IRQ routing: PIRQC# set to 0x0b
00001866362i[P2ISA ] PCI IRQ routing: PIRQD# set to 0x09
00001866362i[P2ISA ] write: ELCR2 = 0x0a
00001867049i[BIOS  ] PIIX3/PIIX4 init: elcr=00 0a
00001874567i[BIOS  ] PCI: bus=0 devfn=0x00: vendor_id=0x8086 device_id=0x1237 class=0x0600
00001877001i[BIOS  ] PCI: bus=0 devfn=0x08: vendor_id=0x8086 device_id=0x7000 class=0x0601
00001879004i[BIOS  ] PCI: bus=0 devfn=0x09: vendor_id=0x8086 device_id=0x7010 class=0x0101
00001879511i[PIDE  ] new BM-DMA address: 0xc000
00001880050i[BIOS  ] region 4: 0x0000c000
00001882001i[BIOS  ] PCI: bus=0 devfn=0x0a: vendor_id=0x8086 device_id=0x7020 class=0x0c03
00001882174i[UHCI  ] new base address: 0xc020
00001882877i[BIOS  ] region 4: 0x0000c020
00001883077i[UHCI  ] new irq line = 9
00001885002i[BIOS  ] PCI: bus=0 devfn=0x0b: vendor_id=0x8086 device_id=0x7113 class=0x0680
00001885204i[ACPI  ] new irq line = 11
00001885238i[ACPI  ] new irq line = 9
00001885257i[ACPI  ] new PM base address: 0xb000
00001885257i[ACPI  ] new SM base address: 0xb100
00001885289i[PCI   ] setting SMRAM control register to 0x4a
00002049407i[CPU0  ] Enter to System Management Mode
00002049407i[CPU0  ] enter_system_management_mode: temporary disable VMX while in SMM mode
00002049411i[CPU0  ] RSM: Resuming from System Management Mode
00002213433i[PCI   ] setting SMRAM control register to 0x0a
00002228039i[BIOS  ] MP table addr=0x000fa570 MPC table addr=0x000fa4a0 size=0xc8
00002230021i[BIOS  ] SMBIOS table addr=0x000fa580
00002232002i[BIOS  ] ACPI tables: RSDP addr=0x000fa6a0 ACPI DATA addr=0x01ff0000 size=0xf72
00002235394i[BIOS  ] Firmware waking vector 0x1ff00cc
00002237336i[PCI   ] i440FX PMC write to PAM register 59 (TLB Flush)
00002238002i[BIOS  ] bios_table_cur_addr: 0x000fa6c4
00002365674i[VBIOS ] VGABios $Id: vgabios.c,v 1.76 2013/02/10 08:07:03 vruppert Exp $

00002365759i[BXVGA ] VBE known Display Interface b0c0
00002365778i[BXVGA ] VBE known Display Interface b0c5
00002368702i[VBIOS ] VBE Bios $Id: vbe.c,v 1.65 2014/07/08 18:02:25 vruppert Exp $
00006580576i[BIOS  ] IDE time out
00019094455i[BIOS  ] Booting from 07c0:0000
00090271490i[CPU0  ] WARNING: HLT instruction with IF=0!
04030956000p[WINGUI] >>PANIC<< POWER button turned off.
04030956000i[CPU0  ] CPU is in protected mode (halted)
04030956000i[CPU0  ] CS.mode = 32 bit
04030956000i[CPU0  ] SS.mode = 32 bit
04030956000i[CPU0  ] EFER   = 0x00000000
04030956000i[CPU0  ] | EAX=00000014  EBX=00106030  ECX=00000720  EDX=00000000
04030956000i[CPU0  ] | ESP=00106030  EBP=0007feac  ESI=00116538  EDI=00116538
04030956000i[CPU0  ] | IOPL=0 ID vip vif ac vm rf nt of df if tf sf zf af pf cf
04030956000i[CPU0  ] | SEG sltr(index|ti|rpl)     base    limit G D
04030956000i[CPU0  ] |  CS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
04030956000i[CPU0  ] |  DS:0018( 0003| 0|  0) 00000000 ffffffff 1 1
04030956000i[CPU0  ] |  SS:0018( 0003| 0|  0) 00000000 ffffffff 1 1
04030956000i[CPU0  ] |  ES:0018( 0003| 0|  0) 00000000 ffffffff 1 1
04030956000i[CPU0  ] |  FS:0018( 0003| 0|  0) 00000000 ffffffff 1 1
04030956000i[CPU0  ] |  GS:0018( 0003| 0|  0) 00000000 ffffffff 1 1
04030956000i[CPU0  ] | EIP=00100169 (00100169)
04030956000i[CPU0  ] | CR0=0x60000011 CR2=0x00000000
04030956000i[CPU0  ] | CR3=0x00000000 CR4=0x00000000
04030956000i[CPU0  ] 0x0000000000100169>> jmp .-3 (0x00100168) : EBFD
04030956000i[CMOS  ] Last time is 1437863570 (Sat Jul 25 23:32:50 2015)
04030956000i[      ] restoring default signal behavior
04030956000i[SIM   ] quit_sim called with exit code 1
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
User avatar
Rusky
Member
Member
Posts: 792
Joined: Wed Jan 06, 2010 7:07 pm

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by Rusky »

TheRussianFail wrote:I have no hlt instruction in the middle of the code.
TheRussianFail wrote:

Code: Select all

	# Hang if kernel_main unexpectedly returns.
	cli
.Lhang:
	hlt
	jmp .Lhang
Did your kernel_main return? Because if it did, cli disables interrupts (IF=0) and then hlt hangs the processor.
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by heat »

Rusky wrote:
TheRussianFail wrote:I have no hlt instruction in the middle of the code.
TheRussianFail wrote:

Code: Select all

	# Hang if kernel_main unexpectedly returns.
	cli
.Lhang:
	hlt
	jmp .Lhang
Did your kernel_main return? Because if it did, cli disables interrupts (IF=0) and then hlt hangs the processor.
The kernel_main did not return, because i had two printf calls to print some phrases on screen, and the screen just stayed black.

Here is the kernel_main function:

Code: Select all

void kernel_main(void)
{
	//Print to the terminal
	printf("Initializing kernel...");
	printf("Kernel initialized!!");
}
What appears in the emulator's window:
http://imageshack.com/a/img661/8951/G140k9.png

Edit1:The image above is after i select the OS entry in GRUB.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
User avatar
Rusky
Member
Member
Posts: 792
Joined: Wed Jan 06, 2010 7:07 pm

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by Rusky »

Perhaps printf is broken, and returns without displaying anything? Add an infinite loop after the printf calls and see if the Bochs warning still shows up.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by iansjack »

TheRussianFail wrote:The kernel_main did not return....
Oh yes it did:
04030956000i[CPU0 ] 0x0000000000100169>> jmp .-3 (0x00100168) : EBFD
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by heat »

iansjack wrote:
TheRussianFail wrote:The kernel_main did not return....
Oh yes it did:
04030956000i[CPU0 ] 0x0000000000100169>> jmp .-3 (0x00100168) : EBFD
So is it the printf function that is broken?Because yesterday i copied the printf file again from the wiki and it still didn't work.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by max »

TheRussianFail wrote:So is it the printf function that is broken?Because yesterday i copied the printf file again from the wiki and it still didn't work.
How about not copying the code and writing your own? Or analyzing what might be wrong with it?
Did you add any code that makes the main hang, or hang afterwards (by looping forever for example)? Otherwise the processor will run into nirvana.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by iansjack »

max wrote:
TheRussianFail wrote:Did you add any code that makes the main hang....
Yes. The code posted by the OP contains a "hlt" instruction, which is where the program has halted.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by SpyderTL »

I'm not sure about BOCHS, but I've seen an issue with some emulators where they only update the screen every few milliseconds, and stop as soon as the CPU stops, so you'll never see the final screen update.

Try taking out the HLT instruction and leave the infinite loop and see if it works like you expect...
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by heat »

The problem seems to be from the printf function.I used gdb to debug the kernel and this appeared when i hit ctrl+c(the command to break execution in gdb):

Code: Select all

[Thread <main>] #1 stopped.
0x0010037c in kernel_main () at arch/i386/../../kernel/kernel.c:17
17              printf("Kernel initialized!!");
which is the last call before the infinite loop.The screen was completely black as it was before.
I will look over my code and see any mistakes i might have done.

Thanks everyone for all the help, :D :mrgreen:
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by gerryg400 »

Re-read the replies. In particular SpyderTL told you what is happening. Try removing the cli before the hlt and see what happens.
If a trainstation is where trains stop, what is a workstation ?
linguofreak
Member
Member
Posts: 510
Joined: Wed Mar 09, 2011 3:55 am

Re: "WARNING: HLT instruction with IF=0!" in bochs

Post by linguofreak »

gerryg400 wrote:Re-read the replies. In particular SpyderTL told you what is happening. Try removing the cli before the hlt and see what happens.
Alternatively, add "while(1);" after the printf statements in kernel_main. Kernel main isn't supposed to return, but as there's no loop after the printf statements, it does return.
Post Reply