Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NkBBT-0003vA-JR for mharc-grub-devel@gnu.org; Wed, 24 Feb 2010 01:57:23 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkBBR-0003v1-H3 for grub-devel@gnu.org; Wed, 24 Feb 2010 01:57:21 -0500 Received: from [140.186.70.92] (port=44667 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkBBQ-0003ut-Ie for grub-devel@gnu.org; Wed, 24 Feb 2010 01:57:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NkBBP-0004S8-Pd for grub-devel@gnu.org; Wed, 24 Feb 2010 01:57:20 -0500 Received: from mail-pv0-f169.google.com ([74.125.83.169]:55885) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkBBP-0004Rw-LA for grub-devel@gnu.org; Wed, 24 Feb 2010 01:57:19 -0500 Received: by pvh11 with SMTP id 11so709429pvh.0 for ; Tue, 23 Feb 2010 22:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ERNQdjqtgrTo/L02pF9Yw6fswGVFSCFDN5eEprPlXiQ=; b=trQCKgdxJLxVNIFJxXDHBhF1THhg4O/G/7l0k/ySf3Mo1TVe8vHbb23OJQm2/4KIQz yjGH9AVOfMGRHfvv0F0eeo0bGqfjoeBDIKZLMzkITgJo9OpHFZJI4I+hA9irWym5z4VT PKgIdfEp5rfZcn+gktiD+84z48fMKki2xJ2U8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=StwUvDCFmgNMl2Jl//D7Ahei3dISj/DovvQ7ER+K2aVVHLt4fGsoCbkWza/mZwFOxa PgkWj1rHqGI/TJZmtXcO4JuJOTQfuxuFyWljfrGqj5lgok6n8YJ3XaoRMUT4ngNeXYqg /b1iYyYDVkmuVSS7VgHW7O5aMu0jit1A23OhM= MIME-Version: 1.0 Received: by 10.142.59.4 with SMTP id h4mr1688429wfa.187.1266994637411; Tue, 23 Feb 2010 22:57:17 -0800 (PST) Date: Wed, 24 Feb 2010 12:27:17 +0530 Message-ID: From: Swapnil Pimpale To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Help regarding booting application processor X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 06:57:22 -0000 Hi all, I am a final year engineering student and I am doing my project in GRUB-1.97~beta4 and Linux Kernel 2.6.24.7. I am working on Intel Core 2 Duo architecture. I want to boot a separate kernel on the second core. As of now, I have brought up the halted AP from the GRUB by sending IPIs in the INIT-SIPI-SIPI sequence. I have also allocated a 4KB page below 1MB and asked the AP to jump to that address. I am trying to put the BSP in while(1) loop and I want the AP to switch from real to protected mode and then jump to start of kernel. But whenever I do a jump to 1MB the system reboots. I am using the following code as the trampoline code for the AP. Can someone please let me know what is wrong in the following code. Awaiting your reply, Thanks, Swapnil Pimpale ----- trampoline.S ----- /* Tell GAS to generate 16-bit instructions so that this code works in real mode. */ #include #include .align 4096 .code16 FUNCTION(TRAMPOLINE_CODE) initial: mov %cs, %ax mov %ax, %ds cli lidtl idtdesc - initial lgdtl gdtdesc - initial mov $0x9e00, %bx // 9e00 is the cs shl $4, %ebx movl $(gdt - initial + 8), %eax movl %ebx, %eax mov $0x10, %bx xor %ecx, %ecx mov $0xb800, %cx // address of video RAM in %cx shl $4, %ecx mov $0x0744, %dx // for printing D xor %eax, %eax pushw %ax mov $0x08, %ax pushw %ax xor %eax, %eax mov $0x9e00, %ax shl $4, %eax add protcseg - initial, %eax pushl %eax xor %eax, %eax movl %cr0, %eax // turn on the PE bit orl $0x1, %eax movl %eax, %cr0 jmp l1 l1: mov %bx, %ds mov %dx, (%ecx) // Print D add $2, %ecx add $1, %dx ADDR32 ljmpl $0x8,$((protcseg - initial) + (0x9e00 << 4)) .align 256 .code32 protcseg: l3: mov %dx, (%ecx) movw %bx, %es movw %bx, %fs movw %bx, %gs movw %bx, %ss l4: // The following is the code used by /loader/i386/linux.c for entering Linux mov $0x8c000, %esi xor %ebx, %ebx mov $0x8c000, %eax jmp *0x214(%eax) // System reboots here l5: jmp l5 .p2align 2 gdt: .word 0, 0 .byte 0, 0, 0, 0 .word 0xFFFF, 0 .byte 0, 0x9A, 0xCF, 0 .word 0xFFFF, 0 .byte 0, 0x92, 0xCF, 0 .word 0xFFFF, 0 .byte 0, 0x9E, 0, 0 .word 0xFFFF, 0 .byte 0, 0x92, 0, 0 gdtdesc: .word 0x27 .long gdt idtdesc: .word 0 .long 0 FUNCTION(TRAMPOLINE_END)