--------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00011Date: 07/05/97 From: PAUL WANKADIA Time: 01:56pm \/To: HERMAN SCHONFELD (Read 1 times) Subj: Memory! On 03 Jul 97, Herman Schonfeld wrote to Paul Wankadia -- HS> PW> I was about to ask you how you got to talking about protected mode HS> PW> from our discussion of real mode. Oh well... HS> In real mode there are no descriptors/selectors so I doubt that we HS> were talking about real mode. I wonder if the segment registers in real mode still have "hidden" parts that the programmer can't get at. --- PPoint 2.00 * Origin: Junyer's Workshop (3:640/772.3) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00012Date: 07/05/97 From: PAUL WANKADIA Time: 01:57pm \/To: HERMAN SCHONFELD (Read 1 times) Subj: more pmode fun On 03 Jul 97, Herman Schonfeld wrote to Paul Wankadia -- HS> Why do you need those tables for anyway? Those tables are maintained HS> by the operating system (the dos extender in your case), you can't HS> PW> I thought I told you ... my program IS the OS. HS> Well you're not going to do it through interrupt calls. That's why I'm trying to load a null IDT. HS> I have no idea on how to load an IDT! Take a look at DJGPP's `go32' if HS> you're after an operating system. I have the Linux source and also have source for a very small OS. Both of them disable interrupts and load GDT and a null IDT with no problems. But when *I* go to do the same, the computer hangs... --- PPoint 2.00 * Origin: Junyer's Workshop (3:640/772.3) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00013Date: 07/05/97 From: PAUL WANKADIA Time: 01:59pm \/To: GLEN MCNABB (Read 1 times) Subj: protected mode On 02 Jul 97, Glen Mcnabb wrote to Paul Wankadia -- PW> What in all the blazes of heck is a "tbyte"??? GM> A tbyte is a ten-bytes data value. Why does it exist, you might ask?. GM> Simple enough. The first numeric co-processors used 80 bit registers. GM> 80 bits is 10 bytes of data. I replied to Jon Gentil about this, asking if a 'tbyte' is identical to the 'long double' data type in "Turbo C++ v3.0". They're both eighty bits long and, of course, are FP, so... --- PPoint 2.00 * Origin: Junyer's Workshop (3:640/772.3) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00014Date: 07/05/97 From: PAUL WANKADIA Time: 02:00pm \/To: "EDWARD BEROSET" (Read 1 times) Subj: FW: protected mode On 03 Jul 97, "Edward Beroset" wrote to All -- "B> Ah. That's a different problem. I thought you'd said that everything "B> was working until you inserted the lidt instruction, but from what you "B> wrote above, it looks more like it's an assembler or linker problem. I've looked at the object code that's generated and it looks fine to me. The linear address is correct, the opcode is correctly prefixed and that byte just after the opcode (the "mod dooby thingy" byte) is correct. I'm beginning to wonder if it IS an alignment problem, but we're in real mode and an "arrangement error" or whatever it's called doesn't apply, does it? "B> I don't mess with AS much, and I'm not at all familiar with djasm, but "B> if you're having some trouble with the jump (or call, or whatever) the "B> very first thing I'd look at is the first intersegment jump after "B> going to protected mode. Your code segment descriptor is set up to be "B> a 32-bit protected mode, but you're jumping via a 16-bit jump. In "B> other words, the "ljmp $0x08, $0x1000" is probably assembling to hex "B> EA 00 10 08 instead of what you probably want, which is 66 EA 00 10 00 "B> 00 08. That's a big difference which would definitely cause the "B> faults I mentioned in a previous message. Nope. With the code as is, the output is correct (i.e. a prefixed 32-bit offset and 16-bit selector). "B> While we're on the subject of assembler tricks, you might also want to "B> check to see that your assembler is putting in a db 66h (size prefix) "B> in front of both the lidt and lgdt instructions. Since you're executing "B> those instructions in 16-bit real mode failure to insert a size override "B> will mean that only a 24-bit base address will be used instead of the "B> 32-bit address that you probably want. OTOH, it might not make any "B> difference in this particular case, but it's probably something you'll "B> want to be aware of. GNU as isn't quite as stupid as some might believe (in spite of the fact that it uses AT&T syntax, which most people seem to hate). The '.code16' directive will make gas prefix all 32-bit operands correctly, which it does. Here's my latest revision of the code : ===== /* boot/setup.S ~~~~~~~~~~~~ Enters protected mode, then JMPs to start of kernel. We are at 0000:0E00 when we start off. */ .file "boot/setup.S" .code16 .text .global start start : /* * Setup segment registers and stack. */ movw %cs, %ax movw %ax, %ds movw %ax, %es movw %ax, %ss movw $0xFFF0, %sp /* * Let user know we're about to enter protected mode. */ movb $0x03, %ah movb $0x00, %bh int $0x10 movw $0x1301, %ax movw $0x07, %bx movw $msg, %bp movw msg_length, %cx int $0x10 /* * Disable all interrupts ... */ cli movb $0x80, %al outb %al, $0x70 /* * ... load GDT and IDT ... */ lgdt gdt_descriptor lidt idt_descriptor /* * ... enter protected mode ... */ movl %cr0, %eax orb $0x01, %al movl %eax, %cr0 /* * ... and JMP to the start of the kernel. */ ljmp $0x08, $0x1000 gdt_descriptor : .word 0x0017 .long gdt gdt : .quad 0x0000000000000000 .quad 0x00CF9A000000FFFF .quad 0x00CF92000000FFFF idt_descriptor : .word 0x0000 .long 0x00000000 msg : .ascii "Entering protected mode...\r\n" msg_length : .word . - msg --- PPoint 2.00 * Origin: Junyer's Workshop (3:640/772.3) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00015Date: 06/30/97 From: BRIAN MCCLOUD Time: 04:35pm \/To: BRIAN ROCHE (Read 1 times) Subj: Re: Copy Protect BR> BM> The first one wouldn't, since diskcopy copies ALL sectors of the BR> BM> source disk regardless of whether or not they're marked as used. BR> Last time I tried using DiskCopy on a copy-protected diskette (oh, back BR> around Dos 3.1 or so) it choked faster than a bimbo at a leper's BR> convention. BR> As long as software is using Dos/Int 21h routines, it won't handle BR> renumbered or crazy sector numbers put in with Bios/Int 13h routines, BR> which was what the majority of Copy-protection schemes used. I don't think my DiskCopy is using int 21h calls... I thinks it's using the int 13h calls... from the diskette with bad sectors I tried to copy, it tried but failed to read many of the sectors which had been marked as bad. ((Cloud)) MauveCloud@juno.com * OLX 2.2 * All I need is a Wave and a board to surf it on. --- PCBoard (R) v15.3/M 10 * Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00016Date: 06/30/97 From: BRIAN MCCLOUD Time: 04:35pm \/To: DAN POST (Read 1 times) Subj: asm tsr DP>I have a problem and was wondering if anyone could help. Does anyone have DP>any tsr code that when activated, will make the computer think that there is DP>a bad sector in a specific spot on drive b (3 1/2" inch drive)? If anyone DP>could help it would be greatly appreciated. You might try making a new int 13h, and checking first AH to see if the function is reading/writing a sector, then checking CX for what sector and DL for which drive. ((Cloud)) MauveCloud@juno.com * OLX 2.2 * Why can't women remember to put the toilet lid back up!? --- PCBoard (R) v15.3/M 10 * Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00017Date: 06/30/97 From: MARTIJN VAN DE STREEK Time: 03:54pm \/To: PAUL WANKADIA (Read 1 times) Subj: Free assemblers Hi Paul, In a message of to Jon Gentil (1:232/211), you wrote: FH> -A86(v4.02), Eric Isaacson JG> EXCELLANT, but not free. PW> It's free, but you have to pay for "A386" and such. And if you want to distribute your programs. I've printed the docs (168 pages) and it said something like that (some code isn't translated the way you want it to). Bye, Martijn. --- The-Box Point 0.15- PC * Origin: The PASCAL programmer knowing the BASICs (2:283/507.4) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00018Date: 06/30/97 From: MARTIJN VAN DE STREEK Time: 03:56pm \/To: ARNOUD BAKKER (Read 1 times) Subj: Huh? Hi Arnoud, In a message of to All (), you wrote: AB> This is the first bit of code from a programm : AB> MOV BP,AX AB> MOV AX,ES AB> ADD AX,10h AB> What is stored in AX that the maker want's to keep? AB> ES is the segment of the PSP, right? No, ES is the EXTRA segment. CS is the Code Segment and DS the Data Segment. (FS & GS are even more extra segments on a 386+) Bye, Martijn. --- The-Box Point 0.15- PC * Origin: The PASCAL programmer knowing the BASICs (2:283/507.4) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBC00019Date: 06/30/97 From: AUKE REITSMA Time: 08:58pm \/To: ARNOUD BAKKER (Read 1 times) Subj: Huh? Hi Arnoud, On 28 Jun 97, 19:01, you wrote to All AB> This is the first bit of code from a programm : AB> MOV BP,AX AB> MOV AX,ES AB> ADD AX,10h AB> What is stored in AX that the maker want's to keep? Whether or not the first two parameters in the commandline start with valid drive letters ... AB> ES is the segment of the PSP, right? Depends ... (afaik) Greetings from _____ /_|__| Auke Reitsma, Delft, The Netherlands. / | \ -------------------------------------- --- GEcho 1.00 * Origin: Home by the C (Auke.Reitsma@net.hcc.nl) (2:281/400.20)