From owner-freebsd-hackers@freebsd.org Thu Apr 14 11:49:38 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F78EB10248 for ; Thu, 14 Apr 2016 11:49:38 +0000 (UTC) (envelope-from afiskon@devzen.ru) Received: from relay14.nicmail.ru (relay14.nicmail.ru [195.208.3.99]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBD4D14E6 for ; Thu, 14 Apr 2016 11:49:36 +0000 (UTC) (envelope-from afiskon@devzen.ru) Received: from [109.70.25.186] (port=58309 helo=fujitsu) by f19.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1aqfm2-000BJ2-Bl for freebsd-hackers@freebsd.org; Thu, 14 Apr 2016 14:49:26 +0300 Received: from [93.174.131.138] (account afiskon@devzen.ru HELO fujitsu) by proxy07.mail.nic.ru (Exim 5.55) with id 1aqfm2-0006dw-IB for freebsd-hackers@freebsd.org; Thu, 14 Apr 2016 14:49:26 +0300 Date: Thu, 14 Apr 2016 14:48:49 +0300 From: Aleksander Alekseev To: freebsd-hackers@freebsd.org Subject: A few stupid questions regarding MBR and boot0 Message-ID: <20160414144849.7a08b1db@fujitsu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2016 11:49:38 -0000 Hello I was trying to figure out how FreeBSD boot process works and noticed something strange. 1) If I understand correctly first 512 bytes of /dev/ad0 and /boot/boot0 file should match, but they don't: http://afiskon.ru/s/31/665dc9755c_mbr.txt Could someone please explain why they don't match? 2) I tried to compile boot0 from source (r297956) but compilation failed: ``` $ cd sys/boot/i386/boot0 $ make Warning: Object directory not changed from original /usr/home/eax/freebsd-src/sys/boot/i386/boot0 /usr/local/bin/clang38 -O2 -pipe -O2 -pipe -g -march=native -DVOLUME_SERIAL -DPXE -DFLAGS=0x8f -DTICKS=0xb6 -DCOMSPEED="7 << 5 + 3" -march=i386 -ffreestanding -msoft-float -m32 -std=gnu99 -Qunused-arguments -m32 -c boot0.S -o boot0.o clang -cc1as: fatal error: error in backend: invalid .org offset '430' (at offset '439') *** Error code 1 Stop. make: stopped in /usr/home/eax/freebsd-src/sys/boot/i386/boot0 ``` Am I doing something wrong? -- Best regards, Aleksander Alekseev http://eax.me/