Hi,
newbi wrote:but in my code i dont understand why choose 1000:00h for bx....
The only person that knows why 1000h:00h was chosen (and not anything else) is the person that wrote "your" code.
Note that the way it uses lower case instructions in some places (e.g. "mov ch,0h ") and upper case instructions in other places (e.g. "MOV AH, 02h") and the different indenting styles tell me that there were at least 2 authors; and the lack of comments and all of the mistakes and bugs (using "[BITS 16]" instead of "BITS 16", not using the "device number" the BIOS gave you, failing to setup a stack before loading data into memory where the stack might still be, the "
on error, repeatedly thrash the floppy drive in an attempt to cause hardware damage" error handling, etc) tells me that none of the different authors knows what they're doing.
Mostly what I'm trying to say here is that I know you're trying to learn (which is good!), but the information (tutorial, example, whatever) that you're trying to learn from is bad, and you need to find better information to learn from.
newbi wrote:...and by filling the first 512 bytes, does that mean, if i read to 513 the kernel? that will work?
You load one sector, which is (almost) always 512 bytes. If your software tries to read the 513th byte then it's reading whatever garbage was left in RAM by firmware.
newbi wrote:and what limit the memory of the kernel in the ram?
What limits the kernel size at the moment is that you only load one sector (which means kernel is limited to 512 bytes).
If you loaded more sectors, the kernel size limit would be "worst_case_EBDA_address - starting_address". The worst case EBDA address is 0x00080000, and if your starting address is 0x00010000 then this gives a kernel size limit of 0x00070000 bytes (or 448 KiB).
If you changed the starting address that kernel is loaded to something lower, like 0x00001000, then it'd give you a kernel size limit of 0x0007F000 bytes (or 508 KiB). This is about as low as the kernel's starting address can be, so this is the "least limiting" limit you can hope for while only using real mode.
To go beyond that limit; you have to use protected mode. The common way is to load part of the kernel (e.g. one track) into a buffer that real mode can access, then switch to protected mode and copy the data somewhere else (e.g. the area starting at 0x00100000), then switch back to real mode and load then next part of the kernel; and so on, until the entire kernel is loaded.
Also note that there's a large amount of additional things you need real mode/BIOS for; including getting a memory map, setting up a video mode, detecting "PCI config space access mechanism", etc. It will not fit in a 512-byte boot loader. To work around that you either need a larger boot loader (where first 512 bytes of boot loader loads the rest of the boot loader before its used) or a second stage (where boot loader loads an "N-sector" second stage, and the second stage gathers all the info from BIOS and loads the kernel).
Cheers,
Brendan