Dear All,
I have attached a linux boot sector file [bootsect.s]
I have read the code several times, but few lines I cant able to understand, can you please help me ?
Line numbers from 172 to 174.
Explanation required for Linux source code [setup.s]
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Explanation required for Linux source code [setup.s]
Shifting an unsigned value left by 9 effectively multiplies it by 2^9, which is 512, the size of a sector. So it is converting a number of sectors into the size of those sectors in bytes, and adding bx, which is explained above as "bx is starting address within segment".
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Explanation required for Linux source code [setup.s]
Its a left shift by 9 bits, in other words, a multiplication by 512. In this case it looks like they are converting sectors to bytes.
Re: Explanation required for Linux source code [setup.s]
Oh god, how simple it is, I cant able to get it.
Thank you very much for Tosi and Cumbuster.
Thank you very much for Tosi and Cumbuster.