Re: Unable to compile GCC-4.4.3, Pass 1
On 03/25/2010 10:45 PM, John Stephens wrote: > Greetings, > > I am attempting to build my first LFS project, but can't see to get past > the GCC, pass 1 compile. FWIW, Linux is not new to me. I have had an > interest in working through a LFS project for several years, and now I > actually have some time to do it. > > I suspect I have a configuration setting gone wrong, however I am unable > to see what is going wrong. > > I have a Ubuntu 9.10 host (AMD Athlon CPU, 1G memory). I've defined an > lsf user and have a separate 50G partition mounted at /mnt/lfs. All the > suggested symlinks are in place. > > > At this point, I believe all is OK. GCC is then unpacked in > $LFS/gcc-build, mpfr-3.4.3 and gmp-5.0.0 are unpacked into > $LFS/gcc-build/gcc-4.4.3 as mpfr and gmp respectively. > > GCC is then configured using: > l...@carina:/mnt/lfs/gcc-build/gcc-4.4.3$ ../gcc-4.4.3/configure > --target=$LFS_TGT --disable-nls --disable-shared --disable-multilib > --disable-decimal-float --disable-threads --disable-libmudflap > --disable-libssp --disable-libgomp --enable-languages=c > ...snip... > configure: creating ./config.status > config.status: creating Makefile I see 3 problems here... 1. The LFS book does not say to create gcc-build before unpacking the source tarball. Seems you need to take a close look at page 5.3, in particular the very last "Note" there - it says that you are to unpack the source tarball, cd into the created directory, *then* follow the instructions on the page. 2. The gcc-build directory is not in $LFS/sources, so that means that either you have become root (or used sudo) to create it, or you have chowned/chmodded $LFS, neither of which you should be doing. If you did this because you were getting permissions errors attempting to create gcc-build, see #1 above that will solve that issue. Also, do not use root/sudo at any point in Chapter 5 until you are told to, and if you did chown/chmod $LFS, change it back (owned by root, 755 permissions). 3. You forgot --prefix on that configure command. That would explain the permission errors on make install. I don't recognize the particular error you are getting and don't know whether it's related to any of the above issues, but the fact that you did miss those is an indicator that you do need to read a bit more closely. The compile errors you are getting are likely due to some other detail you've overlooked. Remove the GCC source and build dirs and try again, this time reading more slowly and carefully. If that still doesn't work, rm -rf /tools/* and go back to the beginning of Chapter 5. > > If I try to do a "make install", I get the following: > > l...@carina:/mnt/lfs/gcc-build/gcc-4.4.3$ make install > make[1]: Entering directory `/mnt/lfs/gcc-build/gcc-4.4.3' > /bin/bash ./mkinstalldirs /usr/local /usr/local > make[2]: Entering directory > `/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/fixincludes' > rm -rf /usr/local/libexec/gcc/i686-lfs-linux-gnu/4.4.3/install-tools > /bin/bash ../.././fixincludes/../mkinstalldirs > /usr/local/libexec/gcc/i686-lfs-linux-gnu/4.4.3/install-tools > mkdir -p -- /usr/local/libexec/gcc/i686-lfs-linux-gnu/4.4.3/install-tools > mkdir: cannot create directory `/usr/local/libexec': Permission denied > make[2]: *** [install] Error 1 > make[2]: Leaving directory > `/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/fixincludes' > make[1]: *** [install-fixincludes] Error 2 > make[1]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.4.3' > make: *** [install] Error 2 Obviously make install won't work if make has errors. > > > Can anyone shed some light on this for me? > > Thanks in advance. > > John Stephens > Bruce is right about gawk, and more generally that you have missed a page about Host System Requirements. I don't believe it affects GCC, but it does need to be addressed as otherwise it will cause problems later. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Bk6.6Ch6.9 glibc compile stopped with `__stack_chk_guard'
Hi All, I've reached LFS Bk6.6 Ch6.9 "Glibc-2.11.1". I've followed the book pretty much to the letter. My variance from book 6.6 consist of: /mnt/lfs/source - source files downloaded into this directory. /mnt/lfs/scratch - source files un-tar'ed and built in this directory. script files - to reduce opps's while cutting and pasting lines to execute i placed them in script files in order to ensure correct transcription from the book. I would then execute the script and verify that it did what it was suppose to. Compilation is on/for an Intel Pentium 4. Jerry's pastbin.com link is almost identical to the output i have of the error: http://linuxfromscratch.pastebin.com/nyYhgsMq pete -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Unable to compile GCC-4.4.3, Pass 1
John Stephens wrote: > checking for gawk... no > checking for mawk... mawk Make sure you have all the prereqs as stated in section vii. Host System Requirements, especially awk->gawk, yacc->bison, and sh->bash. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Problems with HAL
I built HAL, and during the compile received some errors that appeared to be related to the building of the documentation, so I didn't worry about it. I installed it, along with the startup script and thought things were ok. Now I find its not running. The only way to start it is to specify daemon=no. I have searched around and didn't see anyone experiencing problems with HAL. There are no errors in the sys.log, it just won't remain running. Has anyone else experienced this? -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Unable to compile GCC-4.4.3, Pass 1
Greetings, I am attempting to build my first LFS project, but can't see to get past the GCC, pass 1 compile. FWIW, Linux is not new to me. I have had an interest in working through a LFS project for several years, and now I actually have some time to do it. I suspect I have a configuration setting gone wrong, however I am unable to see what is going wrong. I have a Ubuntu 9.10 host (AMD Athlon CPU, 1G memory). I've defined an lsf user and have a separate 50G partition mounted at /mnt/lfs. All the suggested symlinks are in place. My lfs user environment is: l...@carina:~$ env TERM=xterm LC_ALL=POSIX LFS=/mnt/lfs PATH=/tools/bin:/bin:/usr/bin PWD=/home/lfs LFS_TGT=i686-lfs-linux-gnu PS1=${debian_chroot:+($debian_chroot)}...@\h:\w\$ SHLVL=1 HOME=/home/lfs _=/usr/bin/env l...@carina:~$ cat .bash_profile exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash l...@carina:~$ cat .bashrc set +h umask 022 LFS=/mnt/lfs LC_ALL=POSIX LFS_TGT=$(uname -m)-lfs-linux-gnu PATH=/tools/bin:/bin:/usr/bin export LFS LC_ALL LFS_TGT PATH l...@carina:/$ ls -la /tools lrwxrwxrwx 1 root root 15 2010-03-25 21:53 /tools -> /mnt/lfs//tools configuring binutils: l...@carina:/mnt/lfs/binutils-build/binutils-2.20$ ../binutils-2.20/configure --target=$LFS_TGT --prefix=/tools --disable-nls --disable-werror l...@carina:/mnt/lfs/binutils-build/binutils-2.20$make ...snip... make[4]: Leaving directory `/mnt/lfs/binutils-build/binutils-2.20/ld' make[3]: Leaving directory `/mnt/lfs/binutils-build/binutils-2.20/ld' make[2]: Leaving directory `/mnt/lfs/binutils-build/binutils-2.20/ld' make[1]: Nothing to be done for `all-target'. make[1]: Leaving directory `/mnt/lfs/binutils-build/binutils-2.20' l...@carina:/mnt/lfs/binutils-build/binutils-2.20$ make install ...snip... make[3]: Entering directory `/mnt/lfs/binutils-build/binutils-2.20/libiberty/testsuite' make[3]: Nothing to be done for `install'. make[3]: Leaving directory `/mnt/lfs/binutils-build/binutils-2.20/libiberty/testsuite' make[2]: Leaving directory `/mnt/lfs/binutils-build/binutils-2.20/libiberty' make[1]: Nothing to be done for `install-target'. make[1]: Leaving directory `/mnt/lfs/binutils-build/binutils-2.20' At this point, I believe all is OK. GCC is then unpacked in $LFS/gcc-build, mpfr-3.4.3 and gmp-5.0.0 are unpacked into $LFS/gcc-build/gcc-4.4.3 as mpfr and gmp respectively. GCC is then configured using: l...@carina:/mnt/lfs/gcc-build/gcc-4.4.3$ ../gcc-4.4.3/configure --target=$LFS_TGT --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c ...snip... configure: creating ./config.status config.status: creating Makefile Now my project goes south on me make compiles for some time (15 mins?) and then I see the following: l...@carina:/mnt/lfs/gcc-build/gcc-4.4.3$ make ...snip... make[2]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc' Checking multilib configuration for libgcc... mkdir -p -- i686-lfs-linux-gnu/libgcc Configuring in i686-lfs-linux-gnu/libgcc configure: creating cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... no checking for mawk... mawk checking build system type... i686-pc-linux-gnu checking host system type... i686-lfs-linux-gnu checking for i686-lfs-linux-gnu-ar... i686-lfs-linux-gnu-ar checking for i686-lfs-linux-gnu-lipo... i686-lfs-linux-gnu-lipo checking for i686-lfs-linux-gnu-nm... /mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc/nm checking for i686-lfs-linux-gnu-ranlib... i686-lfs-linux-gnu-ranlib checking for i686-lfs-linux-gnu-strip... i686-lfs-linux-gnu-strip checking whether ln -s works... yes checking for i686-lfs-linux-gnu-gcc... /mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc/xgcc -B/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc/ -B/usr/local/i686-lfs-linux-gnu/bin/ -B/usr/local/i686-lfs-linux-gnu/lib/ -isystem /usr/local/i686-lfs-linux-gnu/include -isystem /usr/local/i686-lfs-linux-gnu/sys-include checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc/xgcc -B/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc/ -B/usr/local/i686-lfs-linux-gnu/bin/ -B/usr/local/i686-lfs-linux-gnu/lib/ -isystem /usr/local/i686-lfs-linux-gnu/include -isystem /usr/local/i686-lfs-linux-gnu/sys-include accepts -g... yes checking for /mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc/xgcc -B/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc/ -B/usr/local/i686-lfs-linux-gnu/bin/ -B/usr/local/i686-lfs-linux-gnu/lib/ -isystem /usr/local/i686-lfs-linux-gnu/include -isystem /usr/local/i686-lfs-linux-gnu/sys-include option to accept ANSI C... none needed checking how to run the C preprocessor... /mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/gcc
Re: grub2: error: fiel not found
On 26 March 2010 00:39, Bruce Dubbs wrote: > OK then. Are you at the test phase? That is doing section 8.4.3. > Testing the Configuration. No, as I said earlier, I _was_ using legacy grub, but the new '/' is on ext4 so legacy grub can't get to it. Similarly, I don't have any floppy drives, it's "find a good rescue CD, then try it on the live system". And to sum up, the /boot/boot/grub/ symlink is adequately working around the issue. ĸen -- After tragedy, and farce, "OMG poneys!" -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Problems with HAL
On 25/03/10 23:19, brown wrap wrote: > > > I built HAL, and during the compile received some errors that appeared to be > related to the building of the documentation, so I didn't worry about it. I > installed it, along with the startup script and thought things were ok. Now I > find its not running. The only way to start it is to specify daemon=no. I > have searched around and didn't see anyone experiencing problems with HAL. > There are no errors in the sys.log, it just won't remain running. Has anyone > else experienced this? > HAL is not part of LFS, you should direct questions about things in BLFS to blfs-supp...@linuxfromscratch.org I've never seen the need to build HAL so I can't help with your problem. Andy -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
Ken Moffat wrote: > On 25 March 2010 20:22, Bruce Dubbs wrote: > > >> What happens if you move the set root=(hd0,15) outside the menuentry? >> > I'm fairly sure I tried it, but it made no difference. > >> I'm not sure what you mean by rescue shell. Â Can you elaborate? >> > http://wiki.archlinux.org/index.php/GRUB2#Using_the_command_shell > (end of that section, and into the next). Basically, grub couldn't > load its normal shell (as it would if e.g. grub.cfg was unusable), > so it does its best to let you fix things _if_ you know how. > >> Are you using grub-1.98? >> > No, this is 1.97.2 and the stable book. OK then. Are you at the test phase? That is doing section 8.4.3. Testing the Configuration. If so, what seems to be happening is that grub-install is not creating the /boot/grub/core.img file properly. grub-install is a script. You might try hacking that script around line 312 to see what the value or $modules is for your installation. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 25 March 2010 20:22, Bruce Dubbs wrote: > > What happens if you move the set root=(hd0,15) outside the menuentry? > I'm fairly sure I tried it, but it made no difference. > > I'm not sure what you mean by rescue shell. Can you elaborate? > http://wiki.archlinux.org/index.php/GRUB2#Using_the_command_shell (end of that section, and into the next). Basically, grub couldn't load its normal shell (as it would if e.g. grub.cfg was unusable), so it does its best to let you fix things _if_ you know how. > > Are you using grub-1.98? > No, this is 1.97.2 and the stable book. ĸen -- After tragedy, and farce, "OMG poneys!" -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Problems with HAL
I built HAL, and during the compile received some errors that appeared to be related to the building of the documentation, so I didn't worry about it. I installed it, along with the startup script and thought things were ok. Now I find its not running. The only way to start it is to specify daemon=no. I have searched around and didn't see anyone experiencing problems with HAL. There are no errors in the sys.log, it just won't remain running. Has anyone else experienced this? -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Simple OS Support
Yasin Yenidunya wrote: > i think "direct disc I/O using BIOS" will be enough for me right now. but my > project will be much more. disk access is not a part of the project but i > have to do it in order to get better os and understanding the operating > system. Look at the GRUB2 source. boot/i386/pc/boot.S -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Simple OS Support
i think "direct disc I/O using BIOS" will be enough for me right now. but my project will be much more. disk access is not a part of the project but i have to do it in order to get better os and understanding the operating system. On Thu, Mar 25, 2010 at 11:53 PM, Mike McCarty wrote: > Yasin Yenidunya wrote: > > hi all, > > > > i have the project that building simple operating system for university. > is > > Are you asking for help doing your homework? > > > there anyone that help me to access hard disk drive in real mode. i just > > boot the computer in real mode. then i started to generate GDT and access > > the hard disk drive in chs mode like c=x, h=y and s=z. i don't need to > > partition hdd. i just need the write something on specified block like > > "110111" and read it. is there any guide to help me? > > Are you asking how to use the BIOS INT 13 services, or possibly how > to program the disc interface chips themselves directly? > > If so, then I regret to tell you that both of those are outside the > purview of this echo. I'm sure there are some here who might be > able to help. I've done direct disc I/O using both BIOS, and direct > chip programming for floppies and for Western Digital hard drive > controller chips, though those controller chips are now obsolete. > > However, if you're doing homework, or a class project, then I think > you'll learn a lot more if you first research it some yourself, then > post pointed direct questions where you have problems after making > some progress. > > This would not be the echo for that, though. > > Mike > -- > p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} > Oppose globalization and One World Governments like the UN. > This message made from 100% recycled bits. > You have found the bank of Larn. > I speak only for myself, and I am unanimous in that! > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-support > FAQ: http://www.linuxfromscratch.org/lfs/faq.html > Unsubscribe: See the above information page > -- Yasin Yenidünya mac...@gmail.com -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Simple OS Support
yes it is homework right now but i like it. i want to improve it, and may be i will be one of the developer of lfs. regards On Thu, Mar 25, 2010 at 11:53 PM, Mike McCarty wrote: > Yasin Yenidunya wrote: > > hi all, > > > > i have the project that building simple operating system for university. > is > > Are you asking for help doing your homework? > > > there anyone that help me to access hard disk drive in real mode. i just > > boot the computer in real mode. then i started to generate GDT and access > > the hard disk drive in chs mode like c=x, h=y and s=z. i don't need to > > partition hdd. i just need the write something on specified block like > > "110111" and read it. is there any guide to help me? > > Are you asking how to use the BIOS INT 13 services, or possibly how > to program the disc interface chips themselves directly? > > If so, then I regret to tell you that both of those are outside the > purview of this echo. I'm sure there are some here who might be > able to help. I've done direct disc I/O using both BIOS, and direct > chip programming for floppies and for Western Digital hard drive > controller chips, though those controller chips are now obsolete. > > However, if you're doing homework, or a class project, then I think > you'll learn a lot more if you first research it some yourself, then > post pointed direct questions where you have problems after making > some progress. > > This would not be the echo for that, though. > > Mike > -- > p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} > Oppose globalization and One World Governments like the UN. > This message made from 100% recycled bits. > You have found the bank of Larn. > I speak only for myself, and I am unanimous in that! > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-support > FAQ: http://www.linuxfromscratch.org/lfs/faq.html > Unsubscribe: See the above information page > -- Yasin Yenidünya mac...@gmail.com -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Simple OS Support
here is another tutorial to help me but this code is also didn't working..., http://en.skelix.org/skelixos/tutorial07.php On Thu, Mar 25, 2010 at 11:43 PM, brad martin wrote: > Check out osdev.org > > On Thu, Mar 25, 2010 at 5:41 PM, Yasin Yenidunya wrote: > >> hi all, >> >> i have the project that building simple operating system for university. >> is there anyone that help me to access hard disk drive in real mode. i just >> boot the computer in real mode. then i started to generate GDT and access >> the hard disk drive in chs mode like c=x, h=y and s=z. i don't need to >> partition hdd. i just need the write something on specified block like >> "110111" and read it. is there any guide to help me? >> >> regards >> >> >> -- >> mac...@gmail.com >> >> -- >> http://linuxfromscratch.org/mailman/listinfo/lfs-support >> FAQ: http://www.linuxfromscratch.org/lfs/faq.html >> Unsubscribe: See the above information page >> >> > > > -- > My site: http://www.emclinux.homelinux.com > > http://bccplease.com/ > > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-support > FAQ: http://www.linuxfromscratch.org/lfs/faq.html > Unsubscribe: See the above information page > > -- Yasin Yenidünya mac...@gmail.com -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Simple OS Support
i have chek it already, but most examples are not working i think the our system is not capable to run that code or something like that. finally i found an guide for it but i didn't work. here the guide LBA HDD Access via PIO Every operating system will eventually find a need for reliable, long-term storage. There are only a handful of commonly used storage devices: - Floppy - Flash media - CD-ROM - Hard drive Hard drives are by far the most widely used mechanism for data storage, and this tutorial will familiarize you with a practical method for accessing them. In the past, a method known as CHS was used. With CHS, you specified the cylinder, head, and sector where your data was located. The problem with this method is that the number of cylinders that could be addressed was rather limited. To solve this problem, a new method for accessing hard drives was created: Linear Block Addressing (LBA). With LBA, you simply specify the address of the block you want to access. Blocks are 512-byte chunks of data, so the first 512 bytes of data on the disk are in block 0, the next 512 bytes are in block 1, etc. This is clearly superior to having to calculate and specify three separate bits of information, as with CHS. However, there is one hitch with LBA. There are two forms of LBA, which are slightly different: LBA28 and LBA48. LBA28 uses 28 bits to specify the block address, and LBA48 uses 48 bits. Most drives support LBA28, but not all drives support LBA48. In particular, the Bochs emulator supports LBA28, and not LBA48. This isn't a serious problem, but something to be aware of. Now that you know how LBA works, it's time to see the actual methods involved. To read a sector using LBA28: 1. Send a NULL byte to port 0x1F1: outb(0x1F1, 0x00); 2. Send a sector count to port 0x1F2: outb(0x1F2, 0x01); 3. Send the low 8 bits of the block address to port 0x1F3: outb(0x1F3, (unsigned char)addr); 4. Send the next 8 bits of the block address to port 0x1F4: outb(0x1F4, (unsigned char)(addr >> 8); 5. Send the next 8 bits of the block address to port 0x1F5: outb(0x1F5, (unsigned char)(addr >> 16); 6. Send the drive indicator, some magic bits, and highest 4 bits of the block address to port 0x1F6: outb(0x1F6, 0xE0 | (drive << 4) | ((addr >> 24) & 0x0F)); 7. Send the command (0x20) to port 0x1F7: outb(0x1F7, 0x20); To write a sector using LBA28: Do all the same as above, but send 0x30 for the command byte instead of 0x20: outb(0x1F7, 0x30); To read a sector using LBA48: 1. Send two NULL bytes to port 0x1F1: outb(0x1F1, 0x00); outb(0x1F1, 0x00); 2. Send a 16-bit sector count to port 0x1F2: outb(0x1F2, 0x00); outb(0x1F2, 0x01); 3. Send bits 24-31 to port 0x1F3: outb(0x1F3, (unsigned char)(addr >> 24)); 4. Send bits 0-7 to port 0x1F3: outb(0x1F3, (unsigned char)addr); 5. Send bits 32-39 to port 0x1F4: outb(0x1F4, (unsigned char)(addr >> 32)); 6. Send bits 8-15 to port 0x1F4: outb(0x1F4, (unsigned char)(addr >> 8)); 7. Send bits 40-47 to port 0x1F5: outb(0x1F5, (unsigned char)(addr >> 40)); 8. Send bits 16-23 to port 0x1F5: outb(0x1F5, (unsigned char)(addr >> 16)); 9. Send the drive indicator and some magic bits to port 0x1F6: outb(0x1F6, 0x40 | (drive << 4)); 10. Send the command (0x24) to port 0x1F7: outb(0x1F7, 0x24); To write a sector using LBA48: Do all the same as above, but send 0x34 for the command byte, instead of 0x24: outb(0x1F7, 0x34); Once you've done all this, you just have to wait for the drive to signal that it's ready: while (!(inb(0x1F7) & 0x08)) {} And then read/write your data from/to port 0x1F0: // for read: for (idx = 0; idx < 256; idx++) { tmpword = inw(0x1F0); buffer[idx * 2] = (unsigned char)tmpword; buffer[idx * 2 + 1] = (unsigned char)(tmpword >> 8); } // for write: for (idx = 0; idx < 256; idx++) { tmpword = buffer[8 + idx * 2] | (buffer[8 + idx * 2 + 1] << 8); outw(0x1F0, tmpword); } Of course, all of this is useless if you don't know what drives you actually have hooked up. Each IDE controller can handle 2 drives, and most computers have 2 IDE controllers. The primary controller, which is the one I have been dealing with thus-far has its registers located from port 0x1F0 to port 0x1F7. The secondary controller has its registers in ports 0x170-0x177. Detecting whether controllers are present is fairly easy: 1. Write a magic value to the low LBA port for that controller (0x1F3 for the primary controller, 0x173 for the secondary): outb(0x1F3, 0x88); 2. Read back from the same port, and see if what you read is what you wrote. If it is, that controller exists. Now, you have to detect which drives are present on each controller. To do this, you simply select the appropriate drive with the drive/head select register (0x1F6 for the primary controller, 0x176 for the secondary controller), wait
Re: Simple OS Support
Yasin Yenidunya wrote: > hi all, > > i have the project that building simple operating system for university. is Are you asking for help doing your homework? > there anyone that help me to access hard disk drive in real mode. i just > boot the computer in real mode. then i started to generate GDT and access > the hard disk drive in chs mode like c=x, h=y and s=z. i don't need to > partition hdd. i just need the write something on specified block like > "110111" and read it. is there any guide to help me? Are you asking how to use the BIOS INT 13 services, or possibly how to program the disc interface chips themselves directly? If so, then I regret to tell you that both of those are outside the purview of this echo. I'm sure there are some here who might be able to help. I've done direct disc I/O using both BIOS, and direct chip programming for floppies and for Western Digital hard drive controller chips, though those controller chips are now obsolete. However, if you're doing homework, or a class project, then I think you'll learn a lot more if you first research it some yourself, then post pointed direct questions where you have problems after making some progress. This would not be the echo for that, though. Mike -- p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} Oppose globalization and One World Governments like the UN. This message made from 100% recycled bits. You have found the bank of Larn. I speak only for myself, and I am unanimous in that! -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Simple OS Support
Check out osdev.org On Thu, Mar 25, 2010 at 5:41 PM, Yasin Yenidunya wrote: > hi all, > > i have the project that building simple operating system for university. is > there anyone that help me to access hard disk drive in real mode. i just > boot the computer in real mode. then i started to generate GDT and access > the hard disk drive in chs mode like c=x, h=y and s=z. i don't need to > partition hdd. i just need the write something on specified block like > "110111" and read it. is there any guide to help me? > > regards > > > -- > mac...@gmail.com > > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-support > FAQ: http://www.linuxfromscratch.org/lfs/faq.html > Unsubscribe: See the above information page > > -- My site: http://www.emclinux.homelinux.com http://bccplease.com/ -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Simple OS Support
hi all, i have the project that building simple operating system for university. is there anyone that help me to access hard disk drive in real mode. i just boot the computer in real mode. then i started to generate GDT and access the hard disk drive in chs mode like c=x, h=y and s=z. i don't need to partition hdd. i just need the write something on specified block like "110111" and read it. is there any guide to help me? regards -- mac...@gmail.com -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 25/03/10 20:01, Ken Moffat wrote: > Also, isn't 'insmod ext2' going to be redundant in grub.cfg on an ext2+ > filesystem ? If grub can't read an ext2fs, it won't be able to read > grub.cfg. > In my experience insmod $filesystem isn't needed, grub seems to be able to load those automatically. Though I still need to insmod gfxterm, vbe and png to get a nice picture behind the boot menu. Andy -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
Ken Moffat wrote: >> If /dev/sda15 is your /boot partition, it should then find the grub >> modules in grub/. > My reading was that it didn't. If you look at my original post I had > > |# sda7 LFS-6.6-rc2 pure64 > |menuentry "LFS-6.6-rc2 pure64 2.6.33 (sda7)" { > | insmod ext2 > | set root=(hd0,15) > | search --no-floppy --fs-uuid --set > 5a1327f4-48e3-4bce-afe3-67b388437720 > | linux /vmlinuz-2.6.33-sda7 root=/dev/sda7 > video=radeonfb:1024x768...@70 ro > |} My understanding is that should have worked. Of course, the search line is not used by LFS. I'd remove it just for clarity. > Is that *not* what the book suggests for root= in my case ? In any > case, grub didn't get that far, it was in the rescue shell, not the regular > grub shell. What happens if you move the set root=(hd0,15) outside the menuentry? > And it was the *prefix* hd(0,15)/boot/grub that was the problem - as > I said, I've still no idea where prefix is set. Me either. > /me scratches his head a lot, and rereads section 8.4. All I can see is > 'default root setting - guessed' and the note beneath it, telling me the > default root will be used if a 'set root' instruction is not found in > grub.cfg. I can't see any reference to *how* to alter the default root, > but since it showed up as root=hd(0,15) when I ran 'set' in the rescue > shell, I believe it was already correct. I'm not sure what you mean by rescue shell. Can you elaborate? > Also, isn't 'insmod ext2' going to be redundant in grub.cfg on an ext2+ > filesystem ? If grub can't read an ext2fs, it won't be able to read > grub.cfg. Yes, that makes sense. I don't know if that is necessary. I'd think that ext2 was built into the image loaded at sectors 1-62, where sector 0 is the MBR. Are you using grub-1.98? -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 25 March 2010 20:00, Mike McCarty wrote: > > A nit, but nits are important in this context, shouldn't that be > /dev/sda16 ? Or did I miss something? > No, this is grub2 - on x86, disks still start at zero, but dos partitions have their "real" number (1-4 for primary, 5+ for extended) so (hd0,15) is indeed sda15. ĸen -- After tragedy, and farce, "OMG poneys!" -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 25 March 2010 19:34, Bruce Dubbs wrote: > Ken Moffat wrote: > >> Took me a few minutes to realise what was the main error: >> grub rescue> set >> prefix=(hd0,15)/boot/grub >> root=hd0,15 >> >> After a few more failed attempts to insmod anything, >> I realised that the added '/boot' was the problem. Fixed >> that with >> >> set prefix=(hd0,15)/grub >> insmod normal >> normal > > That isn't how it is supposed to work. You should be using > set root=(hd0,15) > > The books says: "The root setting is the default value if a 'set root' > instruction is not found in grub.cfg. This is the partition that is > searched for the kernel and other supporting files. It is different from > the 'root=' parameter on the 'linux' line in the configuration line. The > latter is the partition the kernel mounts as '/'. In the example > grub.cfg above, both values point to /dev/sda2, but if there is a > separate boot partition, they will be different." > > If /dev/sda15 is your /boot partition, it should then find the grub > modules in grub/. > > > -- Bruce My reading was that it didn't. If you look at my original post I had |# sda7 LFS-6.6-rc2 pure64 |menuentry "LFS-6.6-rc2 pure64 2.6.33 (sda7)" { | insmod ext2 | set root=(hd0,15) | search --no-floppy --fs-uuid --set 5a1327f4-48e3-4bce-afe3-67b388437720 | linux /vmlinuz-2.6.33-sda7 root=/dev/sda7 video=radeonfb:1024x768...@70 ro |} Is that *not* what the book suggests for root= in my case ? In any case, grub didn't get that far, it was in the rescue shell, not the regular grub shell. And it was the *prefix* hd(0,15)/boot/grub that was the problem - as I said, I've still no idea where prefix is set. /me scratches his head a lot, and rereads section 8.4. All I can see is 'default root setting - guessed' and the note beneath it, telling me the default root will be used if a 'set root' instruction is not found in grub.cfg. I can't see any reference to *how* to alter the default root, but since it showed up as root=hd(0,15) when I ran 'set' in the rescue shell, I believe it was already correct. Also, isn't 'insmod ext2' going to be redundant in grub.cfg on an ext2+ filesystem ? If grub can't read an ext2fs, it won't be able to read grub.cfg. ĸen -- After tragedy, and farce, "OMG poneys!" -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
Bruce Dubbs wrote: > Ken Moffat wrote: > >> Took me a few minutes to realise what was the main error: >> grub rescue> set >> prefix=(hd0,15)/boot/grub >> root=hd0,15 >> >> After a few more failed attempts to insmod anything, >> I realised that the added '/boot' was the problem. Fixed >> that with >> >> set prefix=(hd0,15)/grub >> insmod normal >> normal > > That isn't how it is supposed to work. You should be using >set root=(hd0,15) [...] > If /dev/sda15 is your /boot partition, it should then find the grub > modules in grub/. A nit, but nits are important in this context, shouldn't that be /dev/sda16 ? Or did I miss something? Mike -- p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} Oppose globalization and One World Governments like the UN. This message made from 100% recycled bits. You have found the bank of Larn. I speak only for myself, and I am unanimous in that! -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
Ken Moffat wrote: > Took me a few minutes to realise what was the main error: > grub rescue> set > prefix=(hd0,15)/boot/grub > root=hd0,15 > > After a few more failed attempts to insmod anything, > I realised that the added '/boot' was the problem. Fixed > that with > > set prefix=(hd0,15)/grub > insmod normal > normal That isn't how it is supposed to work. You should be using set root=(hd0,15) The books says: "The root setting is the default value if a 'set root' instruction is not found in grub.cfg. This is the partition that is searched for the kernel and other supporting files. It is different from the 'root=' parameter on the 'linux' line in the configuration line. The latter is the partition the kernel mounts as '/'. In the example grub.cfg above, both values point to /dev/sda2, but if there is a separate boot partition, they will be different." If /dev/sda15 is your /boot partition, it should then find the grub modules in grub/. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 3/25/10, Ken Moffat wrote: > 2. From somewhere, the prefix is set to (hd0,15)/boot/grub. I've no > idea where this is set, and trying to set it at the start of grub.cfg > didn't work. So, I've created that path for it - > > mkdir /boot/boot > ln -s ../grub /boot/boot/grub Yep. I always had to do that when /boot was on a separate partition. My new habit is making /boot a regular directory so I would stop being confused about when grub is in /boot or in /. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 25 March 2010 16:09, Ken Moffat wrote: > and at that point I had a menu. I'll take another look > at everything in grub.cfg when I've found my fine > toothcomb ;) > Well, I've now worked around it - it ain't pretty, but bootloaders never are. 1. Booting the wrong system was a pebkac. 2. From somewhere, the prefix is set to (hd0,15)/boot/grub. I've no idea where this is set, and trying to set it at the start of grub.cfg didn't work. So, I've created that path for it - mkdir /boot/boot ln -s ../grub /boot/boot/grub Since I'm expecting to manually edit grub.cfg in future, and for me there is no benefit in "security by obscurity" for its contents, I've changed that file to mode 644. ĸen -- After tragedy, and farce, "OMG poneys!" -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Bk6.6Ch6.9 glibc compile stopped with `__stack_chk_guard'
Andrew Benton wrote: > On 25/03/10 04:08, Mike McCarty wrote: >> x2...@lycos.com wrote: >>> Hi All, >>> >>> I've reached LFS Bk6.6 Ch6.9 "Glibc-2.11.1". >>> >>> I've followed the book pretty much to the letter. >> Translation: >> >> I haven't followed the book; I'm not going to tell in >> what way I deviated,... >> >>> Anyone got a grasp on this problem? >> ... and now I'm having a problem. >> > > LOL Well, at least _one_ person saw it the way I intended it. Since it caused so much uproar, however, I'll apologize to the echo. Sorry. I want as much as anyone to attract new users. Mike -- p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} Oppose globalization and One World Governments like the UN. This message made from 100% recycled bits. You have found the bank of Larn. I speak only for myself, and I am unanimous in that! -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 25 March 2010 15:00, linux fan wrote: > On 3/24/10, Ken Moffat wrote: >> I've finally got round to trying to install grub2 on one of my boxes. > > I messed with grub2 a little. > I tried the 'kernel /core.img' method to get to grub2 from legacy. > > 'set' shows the settings somewhat like bash. > > 'set pager=1' ... I think pages output instead of scrolling so you cannot > read. > 'insmod help' ... maybe > > Getting the correct 'set root=' very important. > insmod ext2 .. of course > > I had success from grub legacy to grub2 with something like: > kernel /core.img > boot > set root= ... correctly > (there may have been another 'set' relevant to path) > insmod ext2 > insmod configfile > (forgot exact) ... configfile (hd0,15)/.../grub.cfg > > I kept hammering and eventually pulled up the grub2 menu. > Sorry, I don't remember exact formulas. > -- Thanks, that was *extremely* helpful. As usual, I've got multiple errors - eventually booted, but not the system I intended :) I hadn't realised that 'set' would show the values. Could have used the pager value earlier, but since then I've got rid of a lot of old kernels. Took me a few minutes to realise what was the main error: grub rescue> set prefix=(hd0,15)/boot/grub root=hd0,15 After a few more failed attempts to insmod anything, I realised that the added '/boot' was the problem. Fixed that with set prefix=(hd0,15)/grub insmod normal normal and at that point I had a menu. I'll take another look at everything in grub.cfg when I've found my fine toothcomb ;) ĸen -- After tragedy, and farce, "OMG poneys!" -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: grub2: error: fiel not found
On 3/24/10, Ken Moffat wrote: > I've finally got round to trying to install grub2 on one of my boxes. I messed with grub2 a little. I tried the 'kernel /core.img' method to get to grub2 from legacy. 'set' shows the settings somewhat like bash. 'set pager=1' ... I think pages output instead of scrolling so you cannot read. 'insmod help' ... maybe Getting the correct 'set root=' very important. insmod ext2 .. of course I had success from grub legacy to grub2 with something like: kernel /core.img boot set root= ... correctly (there may have been another 'set' relevant to path) insmod ext2 insmod configfile (forgot exact) ... configfile (hd0,15)/.../grub.cfg I kept hammering and eventually pulled up the grub2 menu. Sorry, I don't remember exact formulas. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: Bk6.6Ch6.9 glibc compile stopped with `__stack_chk_guard'
On 25/03/10 04:08, Mike McCarty wrote: > x2...@lycos.com wrote: >> Hi All, >> >> I've reached LFS Bk6.6 Ch6.9 "Glibc-2.11.1". >> >> I've followed the book pretty much to the letter. > > Translation: > > I haven't followed the book; I'm not going to tell in > what way I deviated,... > >> Anyone got a grasp on this problem? > > ... and now I'm having a problem. > LOL Well the LFS motto is "Your distro, your rules" so deviation from the book is to be expected. I agree, "pete x2164" should have described the deviations. It would also be helpful if we could see the actual original error message including some of the lines leading up to the error to give it context. Andy -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page