-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add walking region/segment/page table to fix #185 #337
Conversation
I see in the travis build that some builds fail on initializing the loop counter variable
If I fix this by declaring the |
There is also an incompatible assignment in the ESA-390 mode that I will fix.
|
I already figured out that I could just add another commit and push. Currently running travis builds, fingers crossed :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take that back. This pull does not look okay. It doesn't even compile! I can see what you're trying to do however. Let me see if I can fix your code to the way I believe it should be, and then I will submit my version of your code to you for review/approval.
p.s. How do I test it?
Well, I'm certainly open to suggestions. But I had no problem compiling and also the travis runs compiled ok, so can you explain what part does not compile for you? I tested with a ubuntu 18.04 installation as described by the op of the original ticket. Perhaps easiest would be if I send you the dasd, config and some instructions? |
Here's my (untested!) version of (Note: you'll obviously need to rename it from "scescsi.c.txt" to just "scescsi.c". GitHub doesn't allow attaching .c files for some strange reason!)
Well I don't know what the heck you or travis compiled, but it obviously wasn't your code! I cloned your repository (https://github.com/mfsysprog/hyperion-1) and the static void ARCH_DEP(base_segment_walk)(CREG sto, int fd, U32 size)
{
/* we want to find valid page table origins */
CREG pto;
/* segment tables have 2048 entries max */
/* tablelength 0 means 512 entries, 1 means 1024, etc. */
unsigned int entries = ((sto & REGTAB_TL) + 1) * 512;
/* remove bit definitions to form table origin */
#if defined(FEATURE_001_ZARCH_INSTALLED_FACILITY)
sto &= REGTAB_TO;
#else /*!defined(FEATURE_001_ZARCH_INSTALLED_FACILITY)*/
sto &= STD_STO;
#endif /*!defined(FEATURE_001_ZARCH_INSTALLED_FACILITY)*/
#if defined(FEATURE_001_ZARCH_INSTALLED_FACILITY)
DBLWRD *ste;
#else /*!defined(FEATURE_001_ZARCH_INSTALLED_FACILITY)*/
FWORD *ste;
#endif /*!defined(FEATURE_001_ZARCH_INSTALLED_FACILITY)*/
/* walk trough all table entries to find valid items */
unsigned int i;
for(i = 0 ; i < entries ; i++) In C, all variable declarations need to come before any code, and we clearly see your Like I said, there is NO COMPILER ON EARTH that would accept such a clear and obvious error. I don't know what you and travis compiled, but it wasn't your code! It was something else. Maybe you just compiled 4.3? (i.e. without your changes?) But like I said, as it stands, I cannot accept this pull request. I'm sorry. If my replacement code is acceptable to you (if you like it), I can go ahead and commit it under your name (i.e. I can commit my suggested code giving you credit as being the author instead of me). But I don't know what else to do! Your changes are bad! Sorry! |
I'm more that happy to accept your version of the code, it is the result that matters. I will test it today. I understand your point now! Never realised that (ansi) c has the requirement to declare variables before any code. It seems my code will compile since gcc (and most other modern compilers) allow late declaration of variables, but technically it is not valid ansi c code. Point taken! |
Can you give me the definitions for the error messages that you added to |
(Oops!) Sorry. Forgot about that. Here you go: #define HHC00658 "I/O error on read(): rc=%d: \"%s\""
#define HHC00659 "%s is outside of main storage" |
I succesfully tested your code, no problems! |
Fantastic!
Sure. But first, who should get the credit? Should I commit my code under your name? (So you get credit for it?) Or should I commit it under my own name? I would prefer that you get credit for the actual fix (since it was you that diagnosed the problem and figured out how to fix it), but I don't want you to be unfairly blamed for any problems there might be with my code either. So I will only commit it under your name with your express permission. So... yes or no? Do you want me to commit my algorithm under your name as the author? Or would you rather me not do that? Let me know. It's your choice! |
I don't really care about if I get the code credit or not. I'm just happy I managed to figure out what was happening. So feel free to commit under my name, or under your own. Both options are fine with me. |
Fish, That's not quite true. Since the C99 standard, mixing declarations with code is allowed. Microsoft has supported C99 style variable declarations since MSVC++ version 12 (Visual Studio 2013). gcc supported that language feature far earlier. I'm not suggesting any coding style change for Hercules here. Just pointing out that is a feature of C that has been around for a long time. Bill |
(Doh!) You are of course absolutely right. Thank you, Bill.
Right again. I can see I'm going to have to make a greater effort to try and upgrade my 12+ year old Visual Studio 2008 to a more modern version. I know I'm going to hate doing so (later versions of VStudio do not impress me), but I can see my continued delay in doing so will only serve to cause more problems down the road, not less. (sigh!) If only there was a way to just replace the compiler part of my VS2008 install! Doing that is absolutely something I wouldn't hesitate doing. I just don't want to lose my comfortable VS2008 user interface sweater, you know? I'll have to do some research in that area.... |
Me too!
10-4. I'll make the commit right away and close this pull request once I do. THANK YOU for the time and effort (and patience with me!) you've spent working on this issue, Erik. Mucho appreciated! |
Function 'hwl_loadfile' in scescsi.c fixed to load requested file by properly walking the Region and/or Segment and Page tables. Closes GitHub Issue #185 and Pull Request #337. Note: overall fix was developed by Erik, but the logic is actually Fish's, so blame Fish if any problems are discovered! I've committed the fix under his name (with his permission) so that he gets overal credit for the fix since it was his hard work that determined what the problem was and how it should be fixed. Thank you, Erik!
The fix (commit b4c7fee) has now been committed, so I am closing this pull request. Thank you for your effort working on this issue, Erik! Much appreciated! |
The walking region/segment/page table fix had still a few errors around variables "pages" and "tables".
The walking region/segment/page table fix had still a few errors around variables "pages" and "tables", which I've now corrected and tested, but hopefully without introducing other errors for Erik or Fish or others. Please let me know if that were to be the case. Thanks! Peter |
Erik (@mfsysprog), Can you do us a favor and do a git pull to pick up Peter's commit and then do your test again please? Peter has made an update to the hwl loader logic and we want to be sure he didn't accidentally break anything for you. Thanks! |
Tested, it still works fine. |
One small observation, the So testing with a config statement
|
Thanks!
What do you suggest? Don't issue the message on an INFO request, and instead only issue it for a LOAD request? Or perhaps just a separate message number or message text? (e.g. identify what type of request it was, or use a different message number for INFO and a different one for LOAD?) Either way is fine by me and would be a simple change to make. Let me know which you prefer. Thanks! |
I didn't add the messages, so I'm fine with whatever solution. |
this fix is to correctly load a config file fixing #185. I've tried a couple of files (of different length) and they all seem to be properly loaded. I have not been able to test the ESA-390 part of the code, but I've tried to make sure looking at the old code that it still will work. I also did not test the scsiboot, I don't know how that works, but it should still work.